From: <sag...@us...> - 2012-12-11 17:39:08
|
Revision: 1454 http://sourceforge.net/p/modplug/code/1454 Author: saga-games Date: 2012-12-11 17:38:58 +0000 (Tue, 11 Dec 2012) Log Message: ----------- [Fix] Fixed possible overflow in sample allocation (when not using ReadSample). [Ref] Added SanitizeLoops to ModSample struct. Modified Paths: -------------- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters trunk/OpenMPT/soundlib/ITTools.cpp trunk/OpenMPT/soundlib/Load_669.cpp trunk/OpenMPT/soundlib/ModSample.cpp trunk/OpenMPT/soundlib/ModSample.h trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/WAVTools.cpp trunk/OpenMPT/soundlib/XMTools.cpp Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2012-12-10 18:20:55 UTC (rev 1453) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2012-12-11 17:38:58 UTC (rev 1454) @@ -416,7 +416,7 @@ <Filter>Module Loaders</Filter> </ClCompile> <ClCompile Include="..\soundlib\WAVTools.cpp"> - <Filter>Source Files</Filter> + <Filter>Module Loaders</Filter> </ClCompile> </ItemGroup> <ItemGroup> @@ -732,15 +732,15 @@ <ClInclude Include="..\soundlib\SampleFormatConverters.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\soundlib\WAVTools.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\common\FlagSet.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\soundlib\FileReader.h"> <Filter>Module Loaders</Filter> </ClInclude> + <ClInclude Include="..\soundlib\WAVTools.h"> + <Filter>Module Loaders</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <None Include="res\bitmap1.bmp"> Modified: trunk/OpenMPT/soundlib/ITTools.cpp =================================================================== --- trunk/OpenMPT/soundlib/ITTools.cpp 2012-12-10 18:20:55 UTC (rev 1453) +++ trunk/OpenMPT/soundlib/ITTools.cpp 2012-12-11 17:38:58 UTC (rev 1454) @@ -570,6 +570,7 @@ mptSmp.nLoopEnd = loopend; mptSmp.nSustainStart = susloopbegin; mptSmp.nSustainEnd = susloopend; + mptSmp.SanitizeLoops(); // Auto Vibrato settings static const uint8 autovibit2xm[8] = { VIB_SINE, VIB_RAMP_DOWN, VIB_SQUARE, VIB_RANDOM, VIB_RAMP_UP, 0, 0, 0 }; // IT Vibrato -> OpenMPT VibratoType @@ -668,4 +669,4 @@ runtime = static_cast<uint32>(mptHistory.openTime * (18.2f / HISTORY_TIMER_PRECISION)); } -#endif // MODPLUG_TRACKER \ No newline at end of file +#endif // MODPLUG_TRACKER Modified: trunk/OpenMPT/soundlib/Load_669.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_669.cpp 2012-12-10 18:20:55 UTC (rev 1453) +++ trunk/OpenMPT/soundlib/Load_669.cpp 2012-12-11 17:38:58 UTC (rev 1454) @@ -70,14 +70,10 @@ { mptSmp.nLoopEnd = 0; } - LimitMax(mptSmp.nLoopEnd, mptSmp.nLength); - if(mptSmp.nLoopStart >= mptSmp.nLoopEnd) - { - mptSmp.nLoopStart = mptSmp.nLoopEnd = 0; - } if(mptSmp.nLoopEnd != 0) { mptSmp.uFlags = CHN_LOOP; + mptSmp.SanitizeLoops(); } } }; Modified: trunk/OpenMPT/soundlib/ModSample.cpp =================================================================== --- trunk/OpenMPT/soundlib/ModSample.cpp 2012-12-10 18:20:55 UTC (rev 1453) +++ trunk/OpenMPT/soundlib/ModSample.cpp 2012-12-11 17:38:58 UTC (rev 1454) @@ -135,8 +135,14 @@ size_t ModSample::AllocateSample() //-------------------------------- { + // Prevent overflows... + if(nLength > SIZE_MAX - 6u || SIZE_MAX / GetBytesPerSample() < nLength + 6u) + { + return 0; + } FreeSample(); - size_t sampleSize |
From: <sag...@us...> - 2012-12-12 00:50:18
|
Revision: 1455 http://sourceforge.net/p/modplug/code/1455 Author: saga-games Date: 2012-12-12 00:50:08 +0000 (Wed, 12 Dec 2012) Log Message: ----------- [Ref] Removed oooold unzip project and replaced it by a new one, making use of the already existing minizip code from the zlib contrib package. [Ref] Moved zlib/ to include/zlib TODO: Update VS2008 project files. Modified Paths: -------------- trunk/OpenMPT/common/misc_util.cpp trunk/OpenMPT/common/misc_util.h trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/include/zlib/contrib/vstudio/vc10/zlibstat.vcxproj trunk/OpenMPT/include/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj trunk/OpenMPT/mptrack/MPTRACK_08.sln trunk/OpenMPT/mptrack/MPTRACK_10.sln trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/soundlib/FileReader.h trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/load_j2b.cpp trunk/OpenMPT/ungzip/ungzip.cpp trunk/OpenMPT/ungzip/ungzip.h trunk/OpenMPT/ungzip/ungzip_10.vcxproj Added Paths: ----------- trunk/OpenMPT/include/zlib/ trunk/OpenMPT/unzip/unzip.cpp trunk/OpenMPT/unzip/unzip.h trunk/OpenMPT/unzip/unzip_08.vcproj trunk/OpenMPT/unzip/unzip_10.vcxproj Removed Paths: ------------- trunk/OpenMPT/ungzip/ungzip.vcproj trunk/OpenMPT/unzip/Extract.cpp trunk/OpenMPT/unzip/File_io.cpp trunk/OpenMPT/unzip/Inflate.cpp trunk/OpenMPT/unzip/Mapname.cpp trunk/OpenMPT/unzip/Misc.cpp trunk/OpenMPT/unzip/Unimplod.cpp trunk/OpenMPT/unzip/Unreduce.cpp trunk/OpenMPT/unzip/Unshrink.cpp trunk/OpenMPT/unzip/Unzip.cpp trunk/OpenMPT/unzip/Unzip32.h trunk/OpenMPT/unzip/unzip.dsp trunk/OpenMPT/unzip/unzip.vcproj trunk/OpenMPT/unzip/unzip_08.vcproj trunk/OpenMPT/unzip/unzip_10.vcxproj trunk/OpenMPT/zlib/ Property Changed: ---------------- trunk/OpenMPT/mptrack/ Modified: trunk/OpenMPT/common/misc_util.cpp =================================================================== --- trunk/OpenMPT/common/misc_util.cpp 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/common/misc_util.cpp 2012-12-12 00:50:08 UTC (rev 1455) @@ -12,6 +12,8 @@ #include "misc_util.h" #include <ctime> +#ifdef MODPLUG_TRACKER + /* * Loads resource. * [in] lpName and lpType: parameters passed to FindResource(). @@ -60,6 +62,7 @@ return msg; } +#endif // MODPLUG_TRACKER std::basic_string<TCHAR> Util::sdTime::GetDateTimeStr() Modified: trunk/OpenMPT/common/misc_util.h =================================================================== --- trunk/OpenMPT/common/misc_util.h 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/common/misc_util.h 2012-12-12 00:50:08 UTC (rev 1455) @@ -31,21 +31,21 @@ //Convert string to number. template<class T> -inline T ConvertStrTo(LPCSTR psz) -//------------------------------- +inline T ConvertStrTo(const char *str) +//------------------------------------ { #if _HAS_TR1 static_assert(std::tr1::is_const<T>::value == false && std::tr1::is_volatile<T>::value == false, "Const and volatile types are not handled correctly."); #endif if(std::numeric_limits<T>::is_integer) - return static_cast<T>(atoi(psz)); + return static_cast<T>(atoi(str)); else - return static_cast<T>(atof(psz)); + return static_cast<T>(atof(str)); } -template<> inline uint32 ConvertStrTo(LPCSTR psz) {return strtoul(psz, nullptr, 10);} -template<> inline int64 ConvertStrTo(LPCSTR psz) {return _strtoi64(psz, nullptr, 10);} -template<> inline uint64 ConvertStrTo(LPCSTR psz) {return _strtoui64(psz, nullptr, 10);} +template<> inline uint32 ConvertStrTo(const char *str) {return strtoul(str, nullptr, 10);} +template<> inline int64 ConvertStrTo(const char *str) {return _strtoi64(str, nullptr, 10);} +template<> inline uint64 ConvertStrTo(const char *str) {return _strtoui64(str, nullptr, 10);} // Memset given object to zero. @@ -114,8 +114,10 @@ #endif +#ifdef MODPLUG_TRACKER LPCCH LoadResource(LPCTSTR lpName, LPCTSTR lpType, LPCCH& pData, size_t& nSize, HGLOBAL& hglob); CString GetErrorMessage(DWORD nErrorCode); +#endif // MODPLUG_TRACKER namespace utilImpl { @@ -310,6 +312,7 @@ }; +#ifdef MODPLUG_TRACKER namespace Util { namespace sdTime { // Returns string containing date and time ended with newline. @@ -326,3 +329,4 @@ inline bool IsPathFileAvailable(LPCTSTR pszFilePath, FileMode fm) {return (_taccess(pszFilePath, fm) == 0);} } } // namespace Util::sdOs +#endif // MODPLUG_TRACKER Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/common/typedefs.h 2012-12-12 00:50:08 UTC (rev 1455) @@ -23,7 +23,9 @@ //Compile time assert. #define STATIC_ASSERT(expr) C_ASSERT(expr) +#ifndef static_assert #define static_assert(expr, msg) C_ASSERT(expr) +#endif typedef __int8 int8; Modified: trunk/OpenMPT/include/zlib/contrib/vstudio/vc10/zlibstat.vcxproj =================================================================== --- trunk/OpenMPT/zlib/contrib/vstudio/vc10/zlibstat.vcxproj 2012-12-03 00:35:49 UTC (rev 1444) +++ trunk/OpenMPT/include/zlib/contrib/vstudio/vc10/zlibstat.vcxproj 2012-12-12 00:50:08 UTC (rev 1455) @@ -441,7 +441,6 @@ <ClCompile Include="..\..\..\trees.c" /> <ClCompile Include="..\..\..\uncompr.c" /> <ClCompile Include="..\..\minizip\unzip.c" /> - <ClCompile Include="..\..\minizip\zip.c" /> <ClCompile Include="..\..\..\zutil.c" /> </ItemGroup> <ItemGroup> Modified: trunk/OpenMPT/include/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters =================================================================== --- trunk/OpenMPT/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters 2012-12-03 00:35:49 UTC (rev 1444) +++ trunk/OpenMPT/include/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters 2012-12-12 00:50:08 UTC (rev 1455) @@ -57,9 +57,6 @@ <ClCompile Include="..\..\minizip\unzip.c"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\..\minizip\zip.c"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\..\..\zutil.c"> <Filter>Source Files</Filter> </ClCompile> Modified: trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj =================================================================== --- trunk/OpenMPT/zlib/contrib/vstudio/vc9/zlibstat.vcproj 2012-12-03 00:35:49 UTC (rev 1444) +++ trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj 2012-12-12 00:50:08 UTC (rev 1455) @@ -813,10 +813,6 @@ > </File> <File - RelativePath="..\..\minizip\zip.c" - > - </File> - <File RelativePath=".\zlib.rc" > </File> Property changes on: trunk/OpenMPT/mptrack ___________________________________________________________________ Modified: svn:ignore - Debug *.user *.suo *.sdf *.opensdf Release + *.opensdf *.sdf *.suo *.user Debug Release ipch Modified: trunk/OpenMPT/mptrack/MPTRACK_08.sln =================================================================== --- trunk/OpenMPT/mptrack/MPTRACK_08.sln 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/mptrack/MPTRACK_08.sln 2012-12-12 00:50:08 UTC (rev 1455) @@ -20,7 +20,7 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "..\soundtouch\soundtouch_08.vcproj", "{CF3C2CA5-5D45-4635-BBA4-C1F435E10896}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "..\zlib\contrib\vstudio\vc9\zlibstat.vcproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "..\include\zlib\contrib\vstudio\vc9\zlibstat.vcproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ungzip", "..\ungzip\ungzip_08.vcproj", "{94CD7910-649A-4075-9F33-7EBEE614FD45}" ProjectSection(ProjectDependencies) = postProject Modified: trunk/OpenMPT/mptrack/MPTRACK_10.sln =================================================================== --- trunk/OpenMPT/mptrack/MPTRACK_10.sln 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/mptrack/MPTRACK_10.sln 2012-12-12 00:50:08 UTC (rev 1455) @@ -9,18 +9,18 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unrar", "..\unrar\unrar_10.vcxproj", "{FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unzip", "..\unzip\unzip_10.vcxproj", "{44316F22-904E-48AA-B841-5A3A6AC77319}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xsoundlib", "..\xsoundlib\xsoundlib_10.vcxproj", "{DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "..\soundtouch\soundtouch_10.vcxproj", "{CF3C2CA5-5D45-4635-BBA4-C1F435E10896}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ungzip", "..\ungzip\ungzip_10.vcxproj", "{94CD7910-649A-4075-9F33-7EBEE614FD45}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "..\zlib\contrib\vstudio\vc10\zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "..\include\zlib\contrib\vstudio\vc10\zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libFLAC_static", "..\include\flac\src\libFLAC\libFLAC_static_10.vcxproj", "{4CEFBC84-C215-11DB-8314-0800200C9A66}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unzip", "..\unzip\unzip_10.vcxproj", "{F23CC68D-1D58-4EB1-9425-A28F5058EB31}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -39,10 +39,6 @@ {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Debug|Win32.Build.0 = Debug|Win32 {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Release|Win32.ActiveCfg = Release|Win32 {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Release|Win32.Build.0 = Release|Win32 - {44316F22-904E-48AA-B841-5A3A6AC77319}.Debug|Win32.ActiveCfg = Debug|Win32 - {44316F22-904E-48AA-B841-5A3A6AC77319}.Debug|Win32.Build.0 = Debug|Win32 - {44316F22-904E-48AA-B841-5A3A6AC77319}.Release|Win32.ActiveCfg = Release|Win32 - {44316F22-904E-48AA-B841-5A3A6AC77319}.Release|Win32.Build.0 = Release|Win32 {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Debug|Win32.ActiveCfg = Debug|Win32 {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Debug|Win32.Build.0 = Debug|Win32 {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Release|Win32.ActiveCfg = Release|Win32 @@ -63,6 +59,10 @@ {4CEFBC84-C215-11DB-8314-0800200C9A66}.Debug|Win32.Build.0 = Debug|Win32 {4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|Win32.ActiveCfg = Release|Win32 {4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|Win32.Build.0 = Release|Win32 + {F23CC68D-1D58-4EB1-9425-A28F5058EB31}.Debug|Win32.ActiveCfg = Debug|Win32 + {F23CC68D-1D58-4EB1-9425-A28F5058EB31}.Debug|Win32.Build.0 = Debug|Win32 + {F23CC68D-1D58-4EB1-9425-A28F5058EB31}.Release|Win32.ActiveCfg = Release|Win32 + {F23CC68D-1D58-4EB1-9425-A28F5058EB31}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2012-12-12 00:50:08 UTC (rev 1455) @@ -63,7 +63,7 @@ <ClCompile> <AdditionalOptions>/EHsc %(AdditionalOptions)</AdditionalOptions> <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\unlha;..\unzip;..\unrar;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\xsoundlib;..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\xsoundlib;..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;ENABLE_EQ;MODPLUG_TRACKER;NO_PACKING;HAVE_DOT_NET;ENABLE_AMD;ENABLE_SSE;ENABLE_AMDNOW;ENABLE_MMX;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> @@ -88,7 +88,7 @@ </ResourceCompile> <Link> <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions> - <AdditionalDependencies>winmm.lib;strmiids.lib;dmoguids.lib;version.lib;Rpcrt4.lib;delayimp.lib;../include/flac/lib/libFLAC_staticd.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>winmm.lib;strmiids.lib;dmoguids.lib;version.lib;Rpcrt4.lib;delayimp.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>.\Debug/mptrack.exe</OutputFile> <Version>5.0</Version> <SuppressStartupBanner>true</SuppressStartupBanner> @@ -119,7 +119,7 @@ <ClCompile> <Optimization>MaxSpeed</Optimization> <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> - <AdditionalIncludeDirectories>..\unlha;..\unzip;..\unrar;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\xsoundlib;..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\xsoundlib;..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;ENABLE_MMX;ENABLE_EQ;MODPLUG_TRACKER;NO_PACKING;HAVE_DOT_NET;ENABLE_AMD;ENABLE_SSE;ENABLE_AMDNOW;%(PreprocessorDefinitions)</PreprocessorDefinitions> <StringPooling>true</StringPooling> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> @@ -147,7 +147,7 @@ </ResourceCompile> <Link> <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions> - <AdditionalDependencies>winmm.lib;strmiids.lib;dmoguids.lib;version.lib;Rpcrt4.lib;delayimp.lib;wininet.lib;../include/flac/lib/libFLAC_static.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalDependencies>winmm.lib;strmiids.lib;dmoguids.lib;version.lib;Rpcrt4.lib;delayimp.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies> <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> <Version>5.0</Version> <SuppressStartupBanner>true</SuppressStartupBanner> @@ -454,6 +454,12 @@ <None Include="VTune\mptrack.vpj" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\include\flac\src\libFLAC\libFLAC_static_10.vcxproj"> + <Project>{4cefbc84-c215-11db-8314-0800200c9a66}</Project> + </ProjectReference> + <ProjectReference Include="..\include\zlib\contrib\vstudio\vc10\zlibstat.vcxproj"> + <Project>{745dec58-ebb3-47a9-a9b8-4c6627c01bf8}</Project> + </ProjectReference> <ProjectReference Include="..\soundtouch\soundtouch_10.vcxproj"> <Project>{cf3c2ca5-5d45-4635-bba4-c1f435e10896}</Project> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> @@ -471,12 +477,8 @@ <ReferenceOutputAssembly>false</ReferenceOutputAssembly> </ProjectReference> <ProjectReference Include="..\unzip\unzip_10.vcxproj"> - <Project>{44316f22-904e-48aa-b841-5a3a6ac77319}</Project> - <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + <Project>{f23cc68d-1d58-4eb1-9425-a28f5058eb31}</Project> </ProjectReference> - <ProjectReference Include="..\zlib\contrib\vstudio\vc10\zlibstat.vcxproj"> - <Project>{745dec58-ebb3-47a9-a9b8-4c6627c01bf8}</Project> - </ProjectReference> </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> Modified: trunk/OpenMPT/soundlib/FileReader.h =================================================================== --- trunk/OpenMPT/soundlib/FileReader.h 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/soundlib/FileReader.h 2012-12-12 00:50:08 UTC (rev 1455) @@ -15,6 +15,7 @@ #include "Endianness.h" #include <vector> #include <algorithm> +#include <assert.h> //============== @@ -108,7 +109,7 @@ // Return byte count between cursor position and end of file, i.e. how many bytes can still be read. off_t BytesLeft() const { - ASSERT(streamPos <= streamLength); + assert(streamPos <= streamLength); return streamLength - streamPos; } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2012-12-12 00:50:08 UTC (rev 1455) @@ -41,11 +41,11 @@ #endif #ifdef ZIPPED_MOD_SUPPORT -#include "unzip32.h" +#include "../unzip/unzip.h" #endif #ifdef UNRAR_SUPPORT -#include "unrar32.h" +#include "../unrar/unrar32.h" #endif #ifdef UNLHA_SUPPORT @@ -547,56 +547,55 @@ } if (lpStream) { + FileReader file(reinterpret_cast<const char*>(lpStream), dwMemLength); + #ifdef ZIPPED_MOD_SUPPORT - CZipArchive archive(glpszModExtensions); - if (CZipArchive::IsArchive((LPBYTE)lpStream, dwMemLength)) + CZipArchive unzip(file, glpszModExtensions); + if(unzip.IsArchive() && unzip.ExtractFile()) { - if (archive.UnzipArchive((LPBYTE)lpStream, dwMemLength) && archive.GetOutputFile()) - { - lpStream = archive.GetOutputFile(); - dwMemLength = archive.GetOutputFileLength(); - } + file = unzip.GetOutputFile(); + lpStream = (LPCBYTE)file.GetRawData(); + dwMemLength = file.GetLength(); } #endif #ifdef UNRAR_SUPPORT CRarArchive unrar((LPBYTE)lpStream, dwMemLength, glpszModExtensions); - if (unrar.IsArchive()) + if(unrar.IsArchive()) { - if (unrar.ExtrFile() && unrar.GetOutputFile()) + if(unrar.ExtrFile() && unrar.GetOutputFile()) { lpStream = unrar.GetOutputFile(); dwMemLength = unrar.GetOutputFileLength(); + file = FileReader((char *)lpStream, dwMemLength); } } #endif #ifdef UNLHA_SUPPORT CLhaArchive unlha((LPBYTE)lpStream, dwMemLength, glpszModExtensions); - if (unlha.IsArchive()) + if(unlha.IsArchive()) { - if (unlha.ExtractFile() && unlha.GetOutputFile()) + if(unlha.ExtractFile() && unlha.GetOutputFile()) { lpStream = unlha.GetOutputFile(); dwMemLength = unlha.GetOutputFileLength(); + file = FileReader((char *)lpStream, dwMemLength); } } #endif #ifdef UNGZIP_SUPPORT - CGzipArchive ungzip((LPBYTE)lpStream, dwMemLength); - if (ungzip.IsArchive()) + CGzipArchive ungzip(file); + if(ungzip.IsArchive() && ungzip.ExtractFile()) { - if (ungzip.ExtractFile() && ungzip.GetOutputFile()) - { - lpStream = ungzip.GetOutputFile(); - dwMemLength = ungzip.GetOutputFileLength(); - } + file = ungzip.GetOutputFile(); + lpStream = (LPCBYTE)file.GetRawData(); + dwMemLength = file.GetLength(); } #endif + #ifdef MMCMP_SUPPORT BOOL bMMCmp = MMCMP_Unpack(&lpStream, &dwMemLength); #endif - FileReader file(reinterpret_cast<const char*>(lpStream), dwMemLength); - if(!ReadXM(file) // -> CODE#0023 // -> DESC="IT project files (.itp)" @@ -644,13 +643,14 @@ } #ifdef ZIPPED_MOD_SUPPORT - if ((!m_lpszSongComments) && (archive.GetComments(FALSE))) + // Read archive comment if there is no song comment + if((!m_lpszSongComments) && unzip.GetComments(false)) { - m_lpszSongComments = archive.GetComments(TRUE); + m_lpszSongComments = (LPSTR)unzip.GetComments(true); } #endif #ifdef MMCMP_SUPPORT - if (bMMCmp) + if(bMMCmp) { GlobalFreePtr(lpStream); lpStream = NULL; Modified: trunk/OpenMPT/soundlib/load_j2b.cpp =================================================================== --- trunk/OpenMPT/soundlib/load_j2b.cpp 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/soundlib/load_j2b.cpp 2012-12-12 00:50:08 UTC (rev 1455) @@ -17,7 +17,7 @@ #ifndef ZLIB_WINAPI #define ZLIB_WINAPI #endif // ZLIB_WINAPI -#include "../zlib/zlib.h" +#include <zlib/zlib.h> // First off, a nice vibrato translation LUT. Modified: trunk/OpenMPT/ungzip/ungzip.cpp =================================================================== --- trunk/OpenMPT/ungzip/ungzip.cpp 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/ungzip/ungzip.cpp 2012-12-12 00:50:08 UTC (rev 1455) @@ -7,152 +7,125 @@ * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ +#define static_assert // DIRTY! +#include "../soundlib/FileReader.h" #include "ungzip.h" -#include "../soundlib/Endianness.h" +#ifndef ZLIB_WINAPI +#define ZLIB_WINAPI +#endif // ZLIB_WINAPI +#include <zlib/zlib.h> -CGzipArchive::CGzipArchive(LPBYTE lpStream, DWORD dwMemLength) -//------------------------------------------------------------ + +CGzipArchive::CGzipArchive(FileReader &file) : inFile(file) +//--------------------------------------------------------- { - m_lpStream = lpStream; - m_dwStreamLen = dwMemLength; - m_pOutputFile = nullptr; - m_dwOutputLen = 0; + inFile.Rewind(); + inFile.Read(header); } CGzipArchive::~CGzipArchive() //--------------------------- { - if(m_pOutputFile != nullptr) - { - delete[] m_pOutputFile; - } + delete[] outFile.GetRawData(); } bool CGzipArchive::IsArchive() const //---------------------------------- { - if(m_lpStream == nullptr || m_dwStreamLen <= (sizeof(GZheader) + sizeof(GZtrailer))) + if(inFile.GetLength() <= (sizeof(GZheader) + sizeof(GZtrailer))) + { return false; + } // Check header data - GZheader *pHeader = (GZheader *)m_lpStream; - if(pHeader->magic1 != GZ_HMAGIC1 || pHeader->magic2 != GZ_HMAGIC2 || pHeader->method != GZ_HMDEFLATE || (pHeader->flags & GZ_FRESERVED) != 0) - return false; - - // Seems to be OK... - return true; + return (header.magic1 == GZ_HMAGIC1 && header.magic2 == GZ_HMAGIC2 && header.method == GZ_HMDEFLATE && (header.flags & GZ_FRESERVED) == 0); } bool CGzipArchive::ExtractFile() //------------------------------ { - #define ASSERT_CAN_READ(x) \ - if( dwMemPos > m_dwStreamLen || x > m_dwStreamLen - dwMemPos ) return false; - if(!IsArchive()) + { return false; + } - DWORD dwMemPos = 0; - GZheader *pHeader = (GZheader *)m_lpStream; - GZtrailer *pTrailer = (GZtrailer *)(m_lpStream + m_dwStreamLen - sizeof(GZtrailer)); + // Read trailer + GZtrailer trailer; + inFile.Seek(inFile.GetLength() - sizeof(GZtrailer)); + inFile.ReadConvertEndianness(trailer); - dwMemPos += sizeof(GZheader); + // Continue reading header + inFile.Seek(sizeof(GZheader)); - // Extra block present? (ignore) - if(pHeader->flags & GZ_FEXTRA) + // Extra block present? (skip the extra data) + if(header.flags & GZ_FEXTRA) { - ASSERT_CAN_READ(sizeof(uint16)); - uint16 xlen = LittleEndianW(*((uint16 *)m_lpStream + dwMemPos)); - dwMemPos += sizeof(uint16); - // We skip this. - ASSERT_CAN_READ(xlen); - dwMemPos += xlen; + inFile.Skip(inFile.ReadUint16LE()); } // Filename present? (ignore) - if(pHeader->flags & GZ_FNAME) + if(header.flags & GZ_FNAME) { - do - { - ASSERT_CAN_READ(1); - } while (m_lpStream[dwMemPos++] != 0); + while(inFile.ReadUint8() != 0); } // Comment present? (ignore) - if(pHeader->flags & GZ_FCOMMENT) + if(header.flags & GZ_FCOMMENT) { - do - { - ASSERT_CAN_READ(1); - } while (m_lpStream[dwMemPos++] != 0); + while(inFile.ReadUint8() != 0); } - // CRC16 present? - if(pHeader->flags & GZ_FHCRC) + // CRC16 present? (ignore) + if(header.flags & GZ_FHCRC) { - ASSERT_CAN_READ(sizeof(uint16)); - uint16 crc16_h = LittleEndianW(*((uint16 *)m_lpStream + dwMemPos)); - uint16 crc16_f = (uint16)(crc32(0, m_lpStream, dwMemPos) & 0xFFFF); - dwMemPos += sizeof(uint16); - if(crc16_h != crc16_f) - return false; + inFile.Skip(2); } - // Well, this is a bit small when inflated. - if(pTrailer->isize == 0) + // Well, this is a bit small when inflated / deflated. + if(trailer.isize == 0 || inFile.BytesLeft() < sizeof(GZtrailer)) + { return false; + } - // Check if the deflated data is a bit small as well. - ASSERT_CAN_READ(sizeof(GZtrailer) + 1); + delete[] outFile.GetRawData(); - // Clear the output buffer, if necessary. - if(m_pOutputFile != nullptr) + char *data = new (std::nothrow) char[trailer.isize]; + if(data == nullptr) { - delete[] m_pOutputFile; + return false; } - DWORD destSize = LittleEndian(pTrailer->isize); - - m_pOutputFile = new Bytef[destSize]; - if(m_pOutputFile == nullptr) - return false; - // Inflate! z_stream strm; strm.zalloc = Z_NULL; strm.zfree = Z_NULL; strm.opaque = Z_NULL; - strm.avail_in = m_dwStreamLen - (dwMemPos + sizeof(GZtrailer)); - strm.next_in = &m_lpStream[dwMemPos]; + strm.avail_in = inFile.BytesLeft() - sizeof(GZtrailer); + strm.next_in = (Bytef *)(inFile.GetRawData()); if(inflateInit2(&strm, -15) != Z_OK) + { return false; - strm.avail_out = destSize; - strm.next_out = m_pOutputFile; + } + strm.avail_out = trailer.isize; + strm.next_out = (Bytef *)data; - int nRetVal = inflate(&strm, Z_NO_FLUSH); + int retVal = inflate(&strm, Z_NO_FLUSH); inflateEnd(&strm); // Everything went OK? Check return code, number of written bytes and CRC32. - if(nRetVal == Z_STREAM_END && destSize == strm.total_out && LittleEndian(pTrailer->crc32) == crc32(0, m_pOutputFile, destSize)) + if(retVal == Z_STREAM_END && trailer.isize == strm.total_out && trailer.crc32 == crc32(0, (Bytef *)data, trailer.isize)) { // Success! :) - m_dwOutputLen = destSize; + outFile = FileReader(data, trailer.isize); return true; } else { // Fail :( - if(m_pOutputFile != nullptr) - { - delete[] m_pOutputFile; - } - m_pOutputFile = nullptr; - m_lpStream = nullptr; + delete[] outFile.GetRawData(); return false; } - - #undef ASSERT_CAN_READ } Modified: trunk/OpenMPT/ungzip/ungzip.h =================================================================== --- trunk/OpenMPT/ungzip/ungzip.h 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/ungzip/ungzip.h 2012-12-12 00:50:08 UTC (rev 1455) @@ -9,37 +9,12 @@ #pragma once -#ifndef ZLIB_WINAPI -#define ZLIB_WINAPI -#endif // ZLIB_WINAPI -#include "../zlib/zlib.h" -#include "../common/typedefs.h" - - -// magic bytes -#define GZ_HMAGIC1 0x1F -#define GZ_HMAGIC2 0x8B -#define GZ_HMDEFLATE 0x08 -// header flags -#define GZ_FTEXT 0x01 // File is probably ASCII text (who cares) -#define GZ_FHCRC 0x02 // CRC16 present -#define GZ_FEXTRA 0x04 // Extra fields present -#define GZ_FNAME 0x08 // Original filename present -#define GZ_FCOMMENT 0x10 // Comment is present -#define GZ_FRESERVED (~(GZ_FTEXT | GZ_FHCRC | GZ_FEXTRA | GZ_FNAME | GZ_FCOMMENT)) - - //================ class CGzipArchive //================ { protected: - // in - LPBYTE m_lpStream; - DWORD m_dwStreamLen; - // out - Bytef *m_pOutputFile; - DWORD m_dwOutputLen; + FileReader inFile, outFile; #pragma pack(push, 1) @@ -58,17 +33,41 @@ { uint32 crc32; // CRC32 of decompressed data uint32 isize; // Size of decompressed data + + void ConvertEndianness() + { + SwapBytesLE(crc32); + SwapBytesLE(isize); + } }; #pragma pack(pop) + enum MagicBytes + { + GZ_HMAGIC1 = 0x1F, + GZ_HMAGIC2 = 0x8B, + GZ_HMDEFLATE = 0x08, + }; + + enum HeaderFlags + { + GZ_FTEXT = 0x01, // File is probably ASCII text (who cares) + GZ_FHCRC = 0x02, // CRC16 present + GZ_FEXTRA = 0x04, // Extra fields present + GZ_FNAME = 0x08, // Original filename present + GZ_FCOMMENT = 0x10, // Comment is present + GZ_FRESERVED = (~(GZ_FTEXT | GZ_FHCRC | GZ_FEXTRA | GZ_FNAME | GZ_FCOMMENT)) + }; + + GZheader header; + public: - LPBYTE GetOutputFile() const { return m_pOutputFile; } - DWORD GetOutputFileLength() const { return m_dwOutputLen; } + FileReader GetOutputFile() const { return outFile; } bool IsArchive() const; bool ExtractFile(); - CGzipArchive(LPBYTE lpStream, DWORD dwMemLength); + CGzipArchive(FileReader &file); ~CGzipArchive(); }; Deleted: trunk/OpenMPT/ungzip/ungzip.vcproj =================================================================== --- trunk/OpenMPT/ungzip/ungzip.vcproj 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/ungzip/ungzip.vcproj 2012-12-12 00:50:08 UTC (rev 1455) @@ -1,124 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?> -<VisualStudioProject - ProjectType="Visual C++" - Version="7.10" - Name="ungzip" - ProjectGUID="{20BF96C8-0202-4251-80C9-6C62BE845DAE}" - Keyword="Win32Proj"> - <Platforms> - <Platform - Name="Win32"/> - </Platforms> - <Configurations> - <Configuration - Name="Debug|Win32" - OutputDirectory="Debug" - IntermediateDirectory="Debug" - ConfigurationType="4" - CharacterSet="0"> - <Tool - Name="VCCLCompilerTool" - Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;ZLIB_WINAPI" - MinimalRebuild="TRUE" - BasicRuntimeChecks="3" - RuntimeLibrary="3" - BufferSecurityCheck="TRUE" - ForceConformanceInForLoopScope="TRUE" - UsePrecompiledHeader="0" - WarningLevel="4" - Detect64BitPortabilityProblems="TRUE" - DebugInformationFormat="4"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLibrarianTool" - OutputFile="$(OutDir)/ungzip.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="Release" - IntermediateDirectory="Release" - ConfigurationType="4" - CharacterSet="0"> - <Tool - Name="VCCLCompilerTool" - AdditionalOptions="/O2" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;ZLIB_WINAPI" - RuntimeLibrary="0" - ForceConformanceInForLoopScope="TRUE" - UsePrecompiledHeader="0" - WarningLevel="3" - Detect64BitPortabilityProblems="TRUE" - DebugInformationFormat="3"/> - <Tool - Name="VCCustomBuildTool"/> - <Tool - Name="VCLibrarianTool" - OutputFile="$(OutDir)/ungzip.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> - </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=".\ungzip.cpp"> - </File> - </Filter> - <Filter - Name="Header Files" - Filter="h;hpp;hxx;hm;inl;inc;xsd" - UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> - <File - RelativePath=".\ungzip.h"> - </File> - </Filter> - <Filter - Name="Resource Files" - Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx" - UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> - </Filter> - </Files> - <Globals> - </Globals> -</VisualStudioProject> Modified: trunk/OpenMPT/ungzip/ungzip_10.vcxproj =================================================================== --- trunk/OpenMPT/ungzip/ungzip_10.vcxproj 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/ungzip/ungzip_10.vcxproj 2012-12-12 00:50:08 UTC (rev 1455) @@ -52,6 +52,7 @@ <WarningLevel>Level3</WarningLevel> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <OmitDefaultLibName>true</OmitDefaultLibName> + <AdditionalIncludeDirectories>../include/</AdditionalIncludeDirectories> </ClCompile> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> @@ -66,6 +67,7 @@ </DebugInformationFormat> <OmitDefaultLibName>true</OmitDefaultLibName> <MultiProcessorCompilation>true</MultiProcessorCompilation> + <AdditionalIncludeDirectories>../include/</AdditionalIncludeDirectories> </ClCompile> </ItemDefinitionGroup> <ItemGroup> Deleted: trunk/OpenMPT/unzip/Extract.cpp =================================================================== --- trunk/OpenMPT/unzip/Extract.cpp 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/unzip/Extract.cpp 2012-12-12 00:50:08 UTC (rev 1455) @@ -1,368 +0,0 @@ -/*--------------------------------------------------------------------------- - - extract.c - - This file contains the high-level routines ("driver routines") for extrac- - ting and testing zipfile members. It calls the low-level routines in files - inflate.c, unimplod.c, unreduce.c and unshrink.c. - - ---------------------------------------------------------------------------*/ - - -/**************************************/ -/* Function extract_or_test_files() */ -/**************************************/ - -// return PK-type error code -int CZipArchive::ExtractOrTestFiles() -//----------------------------------- -{ - BYTE *cd_inptr; - int cd_incnt, error, error_in_archive=0; - int renamed, query, filnum=-1, blknum=0; - WORD i, j, members_remaining, num_skipped=0; - long int cd_bufstart, bufstart, inbuf_offset, request; - -/*--------------------------------------------------------------------------- - The basic idea of this function is as follows. Since the central di- - rectory lies at the end of the zipfile and the member files lie at the - beginning or middle or wherever, it is not very desirable to simply - read a central directory entry, jump to the member and extract it, and - then jump back to the central directory. In the case of a large zipfile - this would lead to a whole lot of disk-grinding, especially if each mem- - ber file is small. Instead, we read from the central directory the per- - tinent information for a block of files, then go extract/test the whole - block. Thus this routine contains two small(er) loops within a very - large outer loop: the first of the small ones reads a block of files - from the central directory; the second extracts or tests each file; and - the outer one loops over blocks. There's some file-pointer positioning - stuff in between, but that's about it. Btw, it's because of this jump- - ing around that we can afford to be lenient if an error occurs in one of - the member files: we should still be able to go find the other members, - since we know the offset of each from the beginning of the zipfile. - - Begin main loop over blocks of member files. We know the entire central - directory is on this disk: we would not have any of this information un- - less the end-of-central-directory record was on this disk, and we would - not have gotten to this routine unless this is also the disk on which - the central directory starts. In practice, this had better be the ONLY - disk in the archive, but maybe someday we'll add multi-disk support. - ---------------------------------------------------------------------------*/ - - pInfo = info; - members_remaining = ecrec.total_entries_central_dir; - - while (members_remaining) - { - j = 0; - - // Loop through files in central directory, storing offsets, file - // attributes, and case-conversion flags until block size is reached. - while (members_remaining && (j < DIR_BLKSIZ)) - { - --members_remaining; - pInfo = &info[j]; - if (ReadBuf(sig, 4) <= 0) - { - error_in_archive = 51; /* 51: unexpected EOF */ - members_remaining = 0; /* ...so no more left to do */ - break; - } - if (strncmp(sig, central_hdr_sig, 4)) - { /* just to make sure */ - // sig not found - // check binary transfers - error_in_archive = 3; // 3: error in zipfile - members_remaining = 0; // ...so no more left to do - break; - } - /* process_cdir_file_hdr() sets pInfo->hostnum, pInfo->lcflag */ - if ((error = ProcessCDirFileHdr()) != 0) - { - error_in_archive = error; /* only 51 (EOF) defined */ - members_remaining = 0; /* ...so no more left to do */ - break; - } - if ((error = DoString(crec.filename_length, FILENAME)) != 0) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > 1) - { // fatal: no more left to do - members_remaining = 0; - break; - } - } - if ((error = DoString(crec.extra_field_length, EXTRA_FIELD)) != 0) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > 1) - { // fatal - members_remaining = 0; - break; - } - } - if ((error = DoString(crec.file_comment_length, SKIP)) != 0) { - if (error > error_in_archive) - error_in_archive = error; - if (error > 1) - { // fatal - members_remaining = 0; - break; - } - } - if (StoreInfo()) - ++num_skipped; - else - ++j; /* file is OK: save info[] and continue with next */ - } /* end while-loop (adding files to current block) */ - - /* save position in central directory so can come back later */ - cd_bufstart = cur_zipfile_bufstart; - cd_inptr = inptr; - cd_incnt = incnt; - - /*----------------------------------------------------------------------- - Second loop: process files in current block, extracting or testing - each one. - -----------------------------------------------------------------------*/ - - for (i = 0; i < j; ++i) - { - filnum = i + blknum*DIR_BLKSIZ; - pInfo = &info[i]; - /* - * if the target position is not within the current input buffer - * (either haven't yet read far enough, or (maybe) skipping back- - * ward) skip to the target position and reset readbuf(). - */ - request = pInfo->offset + extra_bytes; - inbuf_offset = request % INBUFSIZ; - bufstart = request - inbuf_offset; - - if (request < 0) - { - error_in_archive = 3; // 3: severe error in zipfile, - continue; // but can still go on - } else if (bufstart != cur_zipfile_bufstart) - { - cur_zipfile_bufstart = m_dwPos = bufstart; - if ((incnt = Read(inbuf,INBUFSIZ)) <= 0) - { - error_in_archive = 3; // 3: error in zipfile, but - continue; // can still do next file - } - inptr = inbuf + inbuf_offset; - incnt -= inbuf_offset; - } else { - incnt += (inptr-inbuf) - inbuf_offset; - inptr = inbuf + inbuf_offset; - } - - // should be in proper position now, so check for sig - if (ReadBuf(sig, 4) <= 0) - { // bad offset - error_in_archive = 3; // 3: error in zipfile - continue; // but can still try next one - } - if (strncmp(sig, local_hdr_sig, 4)) - { - error_in_archive = 3; - continue; - } - if ((error = ProcessLocalFileHdr()) != 0) - { - error_in_archive = error; // only 51 (EOF) defined - continue; // can still try next one - } - if ((error = DoString(lrec.filename_length, FILENAME)) != 0) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > 1) - { - continue; // go on to next one - } - } - if ((error = DoString(lrec.extra_field_length, EXTRA_FIELD)) != 0) - { - if (error > error_in_archive) - error_in_archive = error; - if (error > 1) - { - continue; // go on - } - } - - /* - * just about to extract file: if extracting to disk, check if - * already exists, and if so, take appropriate action according to - * fflag/uflag/overwrite_all/etc. (we couldn't do this in upper - * loop because we don't store the possibly renamed filename[] in - * info[]) - */ - renamed = FALSE; // user hasn't renamed output file yet - query = FALSE; - // mapname can create dirs if not freshening or if renamed - if ((error = MapName()) > 1) // Skip - { - if ((error > 2) && (error_in_archive < 2)) - error_in_archive = 2; // (weak) error in zipfile - continue; // go on to next file - } - - if ((error = ExtractOrTestMember()) != 0) - { - if (error > error_in_archive) - error_in_archive = error; // ...and keep going - } - } // end for-loop (i: files in current block) - - - /* - * Jump back to where we were in the central directory, then go and do - * the next batch of files. - */ - - cur_zipfile_bufstart = m_dwPos = cd_bufstart; - Read(inbuf, INBUFSIZ); // were there b4 ==> no error - inptr = cd_inptr; - incnt = cd_incnt; - ++blknum; - - } // end while-loop (blocks of files in central directory) - -/*--------------------------------------------------------------------------- - Double-check that we're back at the end-of-central-directory record, and - print quick summary of results, if we were just testing the archive. We - send the summary to stdout so that people doing the testing in the back- - ground and redirecting to a file can just do a "tail" on the output file. - ---------------------------------------------------------------------------*/ - - ReadBuf(sig, 4); - if (strncmp(sig, end_central_sig, 4)) - { // just to make sure again - if (!error_in_archive) // don't overwrite stronger error - error_in_archive = 1; // 1: warning error - } - if ((num_skipped > 0) && !error_in_archive) // files not tested or - error_in_archive = 1; // extracted: warning - - return (error_in_archive); - -} // end function extract_or_test_files() - - - - - -/***************************/ -/* Function store_info() */ -/***************************/ - -// return 1 if skipping, 0 if OK -int CZipArchive::StoreInfo() -{ -#define UNKN_COMPR (crec.compression_method>IMPLODED && crec.compression_method!=DEFLATED) - -// Check central directory info for version/compatibility requirements. - pInfo->encrypted = crec.general_purpose_bit_flag & 1; // bit field - pInfo->ExtLocHdr = (crec.general_purpose_bit_flag & 8) == 8; // bit - pInfo->text = crec.internal_file_attributes & 1; // bit field - - if (crec.version_needed_to_extract[1] == VMS_) - { - if (crec.version_needed_to_extract[0] > VMS_VERSION) return 1; - // usual file type: don't need VMS to extract - } else - if (crec.version_needed_to_extract[0] > UNZIP_VERSION) return 1; - if UNKN_COMPR return 1; - // Skipping encrypted data - if (pInfo->encrypted) return 1; - -// Store some central-directory information (encryption, offsets) for later use. - pInfo->offset = (long int) crec.relative_offset_local_header; - return 0; -} // end function StoreInfo() - - - - - -/***************************************/ -/* Function extract_or_test_member() */ -/***************************************/ - -// return PK-type error code -int CZipArchive::ExtractOrTestMember() -//------------------------------------ -{ - int error=0; - WORD b; - -// Initialize variables, buffers, etc. - bits_left = 0; - bitbuf = 0L; - outpos = 0L; - outcnt = 0; - outptr = outbuf; - zipeof = 0; - crc32val = 0xFFFFFFFFL; - - memset(outbuf, 0, OUTBUFSIZ); - if (CreateOutputFile()) return 50; // 50: disk full (?) - -// Unpack the file. - switch (lrec.compression_method) - { - case STORED: - while (ReadByte(&b)) OUTB(b); - break; - - case SHRUNK: - unShrink(); - break; - - case REDUCED1: - case REDUCED2: - case REDUCED3: - case REDUCED4: - unReduce(); - break; - - case IMPLODED: - unImplode(); - break; - - case DEFLATED: - if (inflate() != 0) return 3; - break; - - default: // should never get to this point - return 1; - - } // end switch (compression method) - -/*--------------------------------------------------------------------------- - Write the last partial buffer, if any; set the file date and time; and - close the file (not necessarily in that order). Then make sure CRC came - out OK and print result. [Note: crc32val must be logical-ANDed with - 32 bits of 1's, or else machines whose longs are bigger than 32 bits will - report bad CRCs (because of the upper bits being filled with 1's instead - of 0's).] - ---------------------------------------------------------------------------*/ - - if (FlushOutput()) error = 1; - if ((crc32val = ((~crc32val) & 0xFFFFFFFFL)) != lrec.crc32) - { - /* if quietflg is set, we haven't output the filename yet: do it */ - error = 1; // 1: warning error - } - return error; -} // end function ExtractOrTestMember() - - - - - Deleted: trunk/OpenMPT/unzip/File_io.cpp =================================================================== --- trunk/OpenMPT/unzip/File_io.cpp 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/unzip/File_io.cpp 2012-12-12 00:50:08 UTC (rev 1455) @@ -1,229 +0,0 @@ -/*--------------------------------------------------------------------------- - - file_io.c - - This file contains routines for doing direct input/output, file-related - sorts of things. Most of the system-specific code for unzip is contained - here, including the non-echoing password code for decryption (bottom). - - ---------------------------------------------------------------------------*/ - - -/**********************/ -/* Function readbuf() */ -/**********************/ - -// return number of bytes read into buf -int CZipArchive::ReadBuf(char *buf, unsigned int size) -//---------------------------------------------------- -{ - int count; - int n; - - n = size; - while (size) - { - if (incnt == 0) - { - if ((incnt = Read(inbuf, INBUFSIZ)) <= 0) return (n-size); - // buffer ALWAYS starts on a block boundary: - cur_zipfile_bufstart += INBUFSIZ; - inptr = inbuf; - } - count = min((int)size, incnt); - memcpy(buf, inptr, count); - buf += count; - inptr += count; - incnt -= count; - size -= count; - } - return n; -} - - - -/*********************************/ -/* Function create_output_file() */ -/*********************************/ - -// return non-0 if creat failed -int CZipArchive::CreateOutputFile() -//--------------------------------- -{ - CHAR s[64], *filenameext; - int l; - - m_bExtractingComments = FALSE; - l = lstrlen(filename); - while ((l>0) && (filename[l-1] != '.') && (filename[l-1] != '\\')) l--; - if (l<0) l = 0; - filenameext = filename+l; - if ((!lstrcmpi(filenameext, "diz")) - || (!lstrcmpi(filenameext, "nfo")) - || (!lstrcmpi(filenameext, "txt"))) - { - if ((!lstrcmpi(filenameext, "diz")) && (m_lpszComments)) return 2; - m_bExtractingComments = TRUE; - if (m_lpszComments) delete m_lpszComments; - m_lpszComments = NULL; - m_dwCommentsLen = 0; - m_dwCommentsAllocated = 4096; - m_lpszComments = new CHAR[m_dwCommentsAllocated]; - return (m_lpszComments) ? 0 : 1; - } else - { - if (m_lpszExtensions) - { - int i = 0, j = 0; - while (m_lpszExtensions[i]) - { - char c = m_lpszExtensions[i]; - s[j] = c; - if (c == '|') - { - s[j] = 0; - j = 0; - if (!lstrcmpi(filenameext, s)) - { - if (m_lpOutFile) GlobalFreePtr(m_lpOutFile); - m_lpOutFile = NULL; - m_dwOutFileLength = m_dwOutFilePos = 0; - break; - } - } else j++; - i++; - } - } - // Create memory file - if (!m_lpOutFile) - { - m_dwOutFilePos = 0; - m_dwOutFileLength = ziplen * 2 + 1024; - m_lpOutFile = (LPBYTE)GlobalAllocPtr(GHND, m_dwOutFileLength); - if (!m_lpOutFile) return 1; - } - } - return 0; -} - - - - -/**************************** - * Function FillBitBuffer() * - ****************************/ -/* - * Fill bitbuf, which is 32 bits. This function is only used by the - * READBIT and PEEKBIT macros (which are used by all of the uncompression - * routines). - */ -int CZipArchive::FillBitBuffer() -//------------------------------ -{ - WORD temp; - - zipeof = 1; - while ((bits_left < 25) && (ReadByte(&temp) == 8)) - { - bitbuf |= (ULONG)temp << bits_left; - bits_left += 8; - zipeof = 0; - } - return 0; -} - - - - - -/***********************/ -/* Function ReadByte() */ -/***********************/ - -int CZipArchive::ReadByte(WORD *x) -//-------------------------------- -{ - // read a byte; return 8 if byte available, 0 if not - if (csize-- <= 0) return 0; - if (incnt == 0) - { - if ((incnt = Read(inbuf, INBUFSIZ)) <= 0) return 0; - // buffer ALWAYS starts on a block boundary: - cur_zipfile_bufstart += INBUFSIZ; - inptr = inbuf; - } - *x = *inptr++; - --incnt; - return 8; -} - - -int CZipArchive::Write(LPBYTE p, int len) -//--------------------------------------- -{ - if (m_bExtractingComments) - { - if (m_dwCommentsLen+len+1 > m_dwCommentsAllocated) - { - DWORD newlen = m_dwCommentsAllocated + len + 4096; - LPSTR tmp = new CHAR[newlen]; - if (!tmp) return 0; - if (m_lpszComments) memcpy(tmp, m_lpszComments, m_dwCommentsAllocated); - delete m_lpszComments; - m_lpszComments = tmp; - m_dwCommentsAllocated = newlen; - } - if (m_lpszComments) - { - memcpy(m_lpszComments+m_dwCommentsLen, p, len); - m_dwCommentsLen += len; - m_lpszComments[m_dwCommentsLen] = 0; - } - } else - { - if (m_dwOutFilePos+len > m_dwOutFileLength) - { - DWORD newlen = m_dwOutFileLength + len + 16384; - LPBYTE tmp = (LPBYTE)GlobalAllocPtr(GHND, newlen); - if (!tmp) return 0; - memcpy(tmp, m_lpOutFile, m_dwOutFilePos); - GlobalFreePtr(m_lpOutFile); - m_lpOutFile = tmp; - m_dwOutFileLength = newlen; - } - memcpy(m_lpOutFile+m_dwOutFilePos, p, len); - m_dwOutFilePos += len; - } - return len; -} - - - -/**************************/ -/* Function FlushOutput() */ -/**************************/ - -int CZipArchive::FlushOutput() -//---------------------------- -{ - // flush contents of output buffer; return PK-type error code - int len; - - if (outcnt) - { - UpdateCRC(outbuf, outcnt); - len = outcnt; - if (Write(outbuf, len) != len) return 50; - outpos += outcnt; - outcnt = 0; - outptr = outbuf; - } - return 0; // 0: no error -} - - - - - - - Deleted: trunk/OpenMPT/unzip/Inflate.cpp =================================================================== --- trunk/OpenMPT/unzip/Inflate.cpp 2012-12-11 17:38:58 UTC (rev 1454) +++ trunk/OpenMPT/unzip/Inflate.cpp 2012-12-12 00:50:08 UTC (rev 1455) @@ -1,911 +0,0 @@ -/* inflate.c -- put in the public domain by Mark Adler - version c14v, 8 November 1995 */ - - -/* - Inflate deflated (PKZIP's method 8 compressed) data. The compression - method searches for as much of the current string of bytes (up to a - length of 258) in the previous 32K bytes. If it doesn't find any - matches (of at least length 3), it codes the next byte. Otherwise, it - codes the length of the matched string and its distance backwards from - the current position. There is a single Huffman code that codes both - single bytes (called "literals") and match lengths. A second Huffman - code codes the distance information, which follows a length code. Each - length or distance code actually represents a base value and a number - of "extra" (sometimes zero) bits to get to add to the base value. At - the end of each deflated block is a special end-of-block (EOB) literal/ - length code. The decoding process is basically: get a literal/length - code; if EOB then done; if a literal, emit the decoded byte; if a - length then get the distance and emit the referred-to bytes from the - sliding window of previously emitted data. - - There are (currently) three kinds of inflate blocks: stored, fixed, and - dynamic. The compressor outputs a chunk of data at a time and decides - which method to use on a chunk-by-chunk basis. A chunk might typically - be 32K to 64K, uncompressed. If the chunk is uncompressible, then the - "stored" method is used. In this case, the bytes are simply stored as - is, eight bits per byte, with none of the above coding. The bytes are - preceded by a count, since there is no longer an EOB code. - - If the data are compressible, then either the fixed or dynamic methods - are used. In the dynamic method, the compressed data are preceded by - an encoding of the literal/length and distance Huffman codes that are - to be used to decode this block. The representation is itself Huffman - coded, and so is preceded by a description of that code. These code - descriptions take up a little space, and so for small blocks, there is - a predefined set of codes, called the fixed codes. The fixed method is - used if the block ends up smaller that way (usually for quite small - chunks); otherwise the dynamic method is used. In the latter case, the - codes are customized to the probabilities in the current block and so - can code it much better than the pre-determined fixed codes can. - - The Huffman codes themselves are decoded using a multi-level table - lookup, in order to maximize the speed of decoding plus the speed of - building the decoding tables. See the comments below that precede the - lbits and dbits tuning parameters. - - GRR: return values(?) - 0 OK - 1 incomplete table - 2 bad input - 3 not enough memory - */ - - -/* - Notes beyond the 1.93a appnote.txt: - - 1. Distance pointers never point before the beginning of the output - stream. - 2. Distance pointers can point back across blocks, up to 32k away. - 3. There is an implied maximum of 7 bits for the bit length table and - 15 bits for the actual data. - 4. If only one code exists, then it is encoded using one bit. (Zero - would be more efficient, but perhaps a little confusing.) If two - codes exist, they are coded using one bit each (0 and 1). - 5. There is no way of sending zero distance codes--a dummy must be - sent if there are none. (History: a pre 2.0 version of PKZIP would - store blocks with no distance codes, but this was discovered to be - too harsh a criterion.) Valid only for 1.93a. 2.04c does allow - zero distance codes, which is sent as one code of zero bits in - length. - 6. There are up to 286 literal/length codes. Code 256 represents the - end-of-block. Note however that the static length tree defines - 288 codes just to fill out the Huffman codes. Codes 286 and 287 - cannot be used though, since there is no length base or extra bits - defined for them. Similarily, there are up to 30 distance codes. - However, static trees define 32 codes (all 5 bits) to fill out the - Huffman codes, but the last two had better not show up in the data. - 7. Unzip can check dynamic Huffman blocks for complete code sets. - The exception is that a single code would not be complete (see #4). - 8. The five bits following the block type is really the number of - literal codes sent minus 257. - 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits - (1+6+6). Therefore, to output three times the length, you output - three codes (1+1+1), whereas to output four times the same length, - you only need two codes (1+3). Hmm. - 10. In the tree reconstruction algorithm, Code = Code + Increment - only if BitLength(i) is not zero. (Pretty obvious.) - 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) - 12. Note: length code 284 can represent 227-258, but length code 285 - really is 258. The last length deserves its own, short code - since it gets used a lot in very redundant files. The length - 258 is special since 258 - 3 (the min match length) is 255. - 13. The literal/length and distance code bit lengths are read as a - single stream of lengths. It is possible (and advantageous) for - a repeat code (16, 17, or 18) to go across the boundary between - the two sets of lengths. - */ - - -#define PKZIP_BUG_WORKAROUND /* PKZIP 1.93a problem--live with it */ - -/* - inflate.h must supply the uch slide[WSIZE] array, the zvoid typedef - (void if (void *) is accepted, else char) and the NEXTBYTE, - FLUSH() and memzero macros. If the window size is not 32K, it - should also define WSIZE. If INFMOD is defined, it can include - compiled functions to support the NEXTBYTE and/or FLUSH() macros. - There are defaults for NEXTBYTE and FLUSH() below for use as - examples of what those functions need to do. Normally, you would - also want FLUSH() to compute a crc on the data. inflate.h also - needs to provide these typedefs: - - typedef unsigned char uch; - typedef unsigned short ush; - typedef unsigned long ulg; - - */ - - -#define EOF (-1) -#define wsize WSIZE // wsize is a constant -#define FLUSH(n) Write(redirSlide, n) // return value not used - - -/* The inflate algorithm uses a sliding 32K byte window on the uncompressed - stream to find repeated byte strings. This is implemented here as a - circular buffer. The index is updated simply by incrementing and then - and'ing with 0x7fff (32K-1). */ -/* It is left to other modules to supply the 32K area. It is assumed - to be usable as if it were declared "uch slide[32768];" or as just - "uch *slide;" and then malloc'ed in the latter case. The definition - must be in unzip.h, included above. */ - - -/* Tables for deflate from PKZIP's appnote.txt. */ -static unsigned border[] = { /* Order of the bit length code lengths */ - 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; -static WORD cplens[] = { /* Copy lengths for literal codes 257..285 */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - /* note: see note #13 above about the 258 in this list. */ -static WORD cplext[] = { /* Extra bits for literal codes 257..285 */ - 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99}; /* 99==invalid */ -static WORD cpdist[] = { /* Copy offsets for distance codes 0..29 */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577}; -static WORD cpdext[] = { /* Extra bits for distance codes */ - 0, 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}; - - -// And'ing with mask_bits[n] masks the lower n bits -extern DWORD mask_bits[33]; - -/* Macros for inflate() bit peeking and grabbing. - The usage is: - - NEEDBITS(j) - x = b & mask_bits[j]; - DUMPBITS(j) - - ... [truncated message content] |
From: <sag...@us...> - 2012-12-12 01:10:31
|
Revision: 1456 http://sourceforge.net/p/modplug/code/1456 Author: saga-games Date: 2012-12-12 01:10:23 +0000 (Wed, 12 Dec 2012) Log Message: ----------- [Ref] Adjustments to project files [Ref] assert.h seems to add some weight to executables for whatever reason... anyway, it's not needed here. Modified Paths: -------------- trunk/OpenMPT/soundlib/FileReader.h trunk/OpenMPT/ungzip/ungzip_10.vcxproj trunk/OpenMPT/unzip/unzip.cpp trunk/OpenMPT/unzip/unzip_10.vcxproj Modified: trunk/OpenMPT/soundlib/FileReader.h =================================================================== --- trunk/OpenMPT/soundlib/FileReader.h 2012-12-12 00:50:08 UTC (rev 1455) +++ trunk/OpenMPT/soundlib/FileReader.h 2012-12-12 01:10:23 UTC (rev 1456) @@ -15,7 +15,6 @@ #include "Endianness.h" #include <vector> #include <algorithm> -#include <assert.h> //============== @@ -109,7 +108,6 @@ // Return byte count between cursor position and end of file, i.e. how many bytes can still be read. off_t BytesLeft() const { - assert(streamPos <= streamLength); return streamLength - streamPos; } Modified: trunk/OpenMPT/ungzip/ungzip_10.vcxproj =================================================================== --- trunk/OpenMPT/ungzip/ungzip_10.vcxproj 2012-12-12 00:50:08 UTC (rev 1455) +++ trunk/OpenMPT/ungzip/ungzip_10.vcxproj 2012-12-12 01:10:23 UTC (rev 1456) @@ -45,7 +45,7 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_DEBUG;WIN32;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>true</MinimalRebuild> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> @@ -59,7 +59,7 @@ <ClCompile> <Optimization>MaxSpeed</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>NDEBUG;WIN32;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <FunctionLevelLinking>true</FunctionLevelLinking> <WarningLevel>Level3</WarningLevel> Modified: trunk/OpenMPT/unzip/unzip.cpp =================================================================== --- trunk/OpenMPT/unzip/unzip.cpp 2012-12-12 00:50:08 UTC (rev 1455) +++ trunk/OpenMPT/unzip/unzip.cpp 2012-12-12 01:10:23 UTC (rev 1456) @@ -11,7 +11,6 @@ #include "../soundlib/FileReader.h" #include "unzip.h" #include "../common/misc_util.h" -#include <assert.h> #ifndef ZLIB_WINAPI #define ZLIB_WINAPI @@ -224,9 +223,14 @@ info.size_comment++; } char *comment = new char[info.size_comment]; - assert(unzGetGlobalComment(zipFile, comment, info.size_comment) >= 0); - comment[info.size_comment - 1] = '\0'; - return comment; + if(unzGetGlobalComment(zipFile, comment, info.size_comment) >= 0) + { + comment[info.size_comment - 1] = '\0'; + return comment; + } else + { + delete[] comment; + } } return nullptr; } Modified: trunk/OpenMPT/unzip/unzip_10.vcxproj =================================================================== --- trunk/OpenMPT/unzip/unzip_10.vcxproj 2012-12-12 00:50:08 UTC (rev 1455) +++ trunk/OpenMPT/unzip/unzip_10.vcxproj 2012-12-12 01:10:23 UTC (rev 1456) @@ -51,7 +51,7 @@ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>_DEBUG;WIN32;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> <MinimalRebuild>true</MinimalRebuild> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> @@ -65,7 +65,7 @@ <ClCompile> <Optimization>MaxSpeed</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions>NDEBUG;WIN32;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> <RuntimeLibrary>MultiThreaded</RuntimeLibrary> <FunctionLevelLinking>true</FunctionLevelLinking> <WarningLevel>Level3</WarningLevel> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-12 13:36:21
|
Revision: 1457 http://sourceforge.net/p/modplug/code/1457 Author: saga-games Date: 2012-12-12 13:36:13 +0000 (Wed, 12 Dec 2012) Log Message: ----------- [Ref] More small changes to unzip (got rid of the dirty static_assert #define). Modified Paths: -------------- trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/ungzip/ungzip.cpp trunk/OpenMPT/unzip/unzip.cpp Added Paths: ----------- trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_Changes.txt trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_info.txt Removed Paths: ------------- trunk/OpenMPT/include/zlib/contrib/minizip/ChangeLogUnzip trunk/OpenMPT/include/zlib/contrib/minizip/Makefile Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2012-12-12 01:10:23 UTC (rev 1456) +++ trunk/OpenMPT/common/typedefs.h 2012-12-12 13:36:13 UTC (rev 1457) @@ -21,13 +21,15 @@ #define CountOf(x) (sizeof(x)/sizeof(x[0])) #endif -//Compile time assert. +//Compile time assert. +#ifndef C_ASSERT +#define C_ASSERT(expr) typedef char __C_ASSERT__[(expr)?1:-1] +#endif #define STATIC_ASSERT(expr) C_ASSERT(expr) #ifndef static_assert #define static_assert(expr, msg) C_ASSERT(expr) #endif - typedef __int8 int8; typedef __int16 int16; typedef __int32 int32; Deleted: trunk/OpenMPT/include/zlib/contrib/minizip/ChangeLogUnzip =================================================================== --- trunk/OpenMPT/include/zlib/contrib/minizip/ChangeLogUnzip 2012-12-12 01:10:23 UTC (rev 1456) +++ trunk/OpenMPT/include/zlib/contrib/minizip/ChangeLogUnzip 2012-12-12 13:36:13 UTC (rev 1457) @@ -1,67 +0,0 @@ -Change in 1.01e (12 feb 05) -- Fix in zipOpen2 for globalcomment (Rolf Kalbermatter) -- Fix possible memory leak in unzip.c (Zoran Stevanovic) - -Change in 1.01b (20 may 04) -- Integrate patch from Debian package (submited by Mark Brown) -- Add tools mztools from Xavier Roche - -Change in 1.01 (8 may 04) -- fix buffer overrun risk in unzip.c (Xavier Roche) -- fix a minor buffer insecurity in minizip.c (Mike Whittaker) - -Change in 1.00: (10 sept 03) -- rename to 1.00 -- cosmetic code change - -Change in 0.22: (19 May 03) -- crypting support (unless you define NOCRYPT) -- append file in existing zipfile - -Change in 0.21: (10 Mar 03) -- bug fixes - -Change in 0.17: (27 Jan 02) -- bug fixes - -Change in 0.16: (19 Jan 02) -- Support of ioapi for virtualize zip file access - -Change in 0.15: (19 Mar 98) -- fix memory leak in minizip.c - -Change in 0.14: (10 Mar 98) -- fix bugs in minizip.c sample for zipping big file -- fix problem in month in date handling -- fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for - comment handling - -Change in 0.13: (6 Mar 98) -- fix bugs in zip.c -- add real minizip sample - -Change in 0.12: (4 Mar 98) -- add zip.c and zip.h for creates .zip file -- fix change_file_date in miniunz.c for Unix (Jean-loup Gailly) -- fix miniunz.c for file without specific record for directory - -Change in 0.11: (3 Mar 98) -- fix bug in unzGetCurrentFileInfo for get extra field and comment -- enhance miniunz sample, remove the bad unztst.c sample - -Change in 0.10: (2 Mar 98) -- fix bug in unzReadCurrentFile -- rename unzip* to unz* function and structure -- remove Windows-like hungary notation variable name -- modify some structure in unzip.h -- add somes comment in source -- remove unzipGetcCurrentFile function -- replace ZUNZEXPORT by ZEXPORT -- add unzGetLocalExtrafield for get the local extrafield info -- add a new sample, miniunz.c - -Change in 0.4: (25 Feb 98) -- suppress the type unzipFileInZip. - Only on file in the zipfile can be open at the same time -- fix somes typo in code -- added tm_unz structure in unzip_file_info (date/time in readable format) Deleted: trunk/OpenMPT/include/zlib/contrib/minizip/Makefile =================================================================== --- trunk/OpenMPT/include/zlib/contrib/minizip/Makefile 2012-12-12 01:10:23 UTC (rev 1456) +++ trunk/OpenMPT/include/zlib/contrib/minizip/Makefile 2012-12-12 13:36:13 UTC (rev 1457) @@ -1,25 +0,0 @@ -CC=cc -CFLAGS=-O -I../.. - -UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a -ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a - -.c.o: - $(CC) -c $(CFLAGS) $*.c - -all: miniunz minizip - -miniunz: $(UNZ_OBJS) - $(CC) $(CFLAGS) -o $@ $(UNZ_OBJS) - -minizip: $(ZIP_OBJS) - $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS) - -test: miniunz minizip - ./minizip test readme.txt - ./miniunz -l test.zip - mv readme.txt readme.old - ./miniunz test.zip - -clean: - /bin/rm -f *.o *~ minizip miniunz Added: trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_Changes.txt =================================================================== --- trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_Changes.txt (rev 0) +++ trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_Changes.txt 2012-12-12 13:36:13 UTC (rev 1457) @@ -0,0 +1,6 @@ + +MiniZip 1.1 was derrived from MiniZip at version 1.01f + +Change in 1.0 (Okt 2009) + - **TODO - Add history** + Added: trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_info.txt =================================================================== --- trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_info.txt (rev 0) +++ trunk/OpenMPT/include/zlib/contrib/minizip/MiniZip64_info.txt 2012-12-12 13:36:13 UTC (rev 1457) @@ -0,0 +1,74 @@ +MiniZip - Copyright (c) 1998-2010 - by Gilles Vollant - version 1.1 64 bits from Mathias Svensson + +Introduction +--------------------- +MiniZip 1.1 is built from MiniZip 1.0 by Gilles Vollant ( http://www.winimage.com/zLibDll/minizip.html ) + +When adding ZIP64 support into minizip it would result into risk of breaking compatibility with minizip 1.0. +All possible work was done for compatibility. + + +Background +--------------------- +When adding ZIP64 support Mathias Svensson found that Even Rouault have added ZIP64 +support for unzip.c into minizip for a open source project called gdal ( http://www.gdal.org/ ) + +That was used as a starting point. And after that ZIP64 support was added to zip.c +some refactoring and code cleanup was also done. + + +Changed from MiniZip 1.0 to MiniZip 1.1 +--------------------------------------- +* Added ZIP64 support for unzip ( by Even Rouault ) +* Added ZIP64 support for zip ( by Mathias Svensson ) +* Reverted some changed that Even Rouault did. +* Bunch of patches received from Gulles Vollant that he received for MiniZip from various users. +* Added unzip patch for BZIP Compression method (patch create by Daniel Borca) +* Added BZIP Compress method for zip +* Did some refactoring and code cleanup + + +Credits + + Gilles Vollant - Original MiniZip author + Even Rouault - ZIP64 unzip Support + Daniel Borca - BZip Compression method support in unzip + Mathias Svensson - ZIP64 zip support + Mathias Svensson - BZip Compression method support in zip + + Resources + + ZipLayout http://result42.com/projects/ZipFileLayout + Command line tool for Windows that shows the layout and information of the headers in a zip archive. + Used when debugging and validating the creation of zip files using MiniZip64 + + + ZIP App Note http://www.pkware.com/documents/casestudies/APPNOTE.TXT + Zip File specification + + +Notes. + * To be able to use BZip compression method in zip64.c or unzip64.c the BZIP2 lib is needed and HAVE_BZIP2 need to be defined. + +License +---------------------------------------------------------- + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +---------------------------------------------------------- + Modified: trunk/OpenMPT/ungzip/ungzip.cpp =================================================================== --- trunk/OpenMPT/ungzip/ungzip.cpp 2012-12-12 01:10:23 UTC (rev 1456) +++ trunk/OpenMPT/ungzip/ungzip.cpp 2012-12-12 13:36:13 UTC (rev 1457) @@ -7,7 +7,6 @@ * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ -#define static_assert // DIRTY! #include "../soundlib/FileReader.h" #include "ungzip.h" Modified: trunk/OpenMPT/unzip/unzip.cpp =================================================================== --- trunk/OpenMPT/unzip/unzip.cpp 2012-12-12 01:10:23 UTC (rev 1456) +++ trunk/OpenMPT/unzip/unzip.cpp 2012-12-12 13:36:13 UTC (rev 1457) @@ -7,7 +7,6 @@ * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ -#define static_assert // DIRTY! #include "../soundlib/FileReader.h" #include "unzip.h" #include "../common/misc_util.h" @@ -21,22 +20,22 @@ // Low-level file abstractions for in-memory file handling struct ZipFileAbstraction { - static voidpf ZCALLBACK fopen_mem(voidpf opaqe, const char *filename, int mode) + static voidpf ZCALLBACK fopen_mem(voidpf opaque, const char *, int mode) { - FileReader &file = *static_cast<FileReader *>(opaqe); + FileReader &file = *static_cast<FileReader *>(opaque); if((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER) == ZLIB_FILEFUNC_MODE_WRITE) { return nullptr; } else { file.Rewind(); - return opaqe; + return opaque; } } - static uLong ZCALLBACK fread_mem(voidpf opaqe, voidpf, void *buf, uLong size) + static uLong ZCALLBACK fread_mem(voidpf opaque, voidpf, void *buf, uLong size) { - FileReader &file = *static_cast<FileReader *>(opaqe); + FileReader &file = *static_cast<FileReader *>(opaque); if(size > file.BytesLeft()) { size = file.BytesLeft(); @@ -51,15 +50,15 @@ return 0; } - static long ZCALLBACK ftell_mem(voidpf opaqe, voidpf) + static long ZCALLBACK ftell_mem(voidpf opaque, voidpf) { - FileReader &file = *static_cast<FileReader *>(opaqe); + FileReader &file = *static_cast<FileReader *>(opaque); return file.GetPosition(); } - static long ZCALLBACK fseek_mem(voidpf opaqe, voidpf, uLong offset, int origin) + static long ZCALLBACK fseek_mem(voidpf opaque, voidpf, uLong offset, int origin) { - FileReader &file = *static_cast<FileReader *>(opaqe); + FileReader &file = *static_cast<FileReader *>(opaque); switch(origin) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-12 21:07:42
|
Revision: 1458 http://sourceforge.net/p/modplug/code/1458 Author: saga-games Date: 2012-12-12 21:07:34 +0000 (Wed, 12 Dec 2012) Log Message: ----------- [Mod] Changed some things in the MOD loader regarding a problem with MOD saving after removing samples (reported by bubsy as a general problem, but no confirmation with test cases, so it's mostly guess work.) [Mod] Further changes to zip loader. Modified Paths: -------------- trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/unzip/unzip.cpp Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2012-12-12 13:36:13 UTC (rev 1457) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2012-12-12 21:07:34 UTC (rev 1458) @@ -269,7 +269,7 @@ } if (mptSmp.nLoopEnd > mptSmp.nLoopStart) { - mptSmp.uFlags |= CHN_LOOP; + mptSmp.uFlags.set(CHN_LOOP); } } } @@ -277,7 +277,7 @@ // Convert OpenMPT's internal sample header to an MOD sample header. SmpLength ConvertToMOD(const ModSample &mptSmp) { - SmpLength writeLength = mptSmp.nLength; + SmpLength writeLength = mptSmp.pSample != nullptr ? mptSmp.nLength : 0; // If the sample size is odd, we have to add a padding byte, as all sample sizes in MODs are even. if((writeLength % 2) != 0) { @@ -301,7 +301,7 @@ loopStart = 0; loopLength = 1; - if(mptSmp.uFlags & CHN_LOOP) + if(mptSmp.uFlags[CHN_LOOP]) { loopStart = static_cast<uint16>(mptSmp.nLoopStart / 2); loopLength = static_cast<uint16>(max(1, (mptSmp.nLoopEnd - mptSmp.nLoopStart) / 2)); @@ -782,7 +782,7 @@ { MODSampleHeader sampleHeader; StringFixer::WriteString<StringFixer::maybeNullTerminated>(sampleHeader.name, m_szNames[sampleSource[smp]]); - sampleLength[smp] = sampleHeader.ConvertToMOD(Samples[sampleSource[smp]]); + sampleLength[smp] = sampleHeader.ConvertToMOD(sampleSource[smp] <= GetNumSamples() ? GetSample(sampleSource[smp]) : ModSample(MOD_TYPE_MOD)); sampleHeader.ConvertEndianness(); fwrite(&sampleHeader, sizeof(sampleHeader), 1, f); } Modified: trunk/OpenMPT/unzip/unzip.cpp =================================================================== --- trunk/OpenMPT/unzip/unzip.cpp 2012-12-12 13:36:13 UTC (rev 1457) +++ trunk/OpenMPT/unzip/unzip.cpp 2012-12-12 21:07:34 UTC (rev 1458) @@ -1,7 +1,7 @@ /* * unzip.cpp * --------- - * Purpose: Implementation file for extracting modules from .zip archives + * Purpose: Implementation file for extracting modules from .zip archives, making use of MiniZip (from the zlib contrib package) * Notes : (currently none) * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. @@ -174,7 +174,8 @@ if(lstrcmpi(ext, "diz") && lstrcmpi(ext, "nfo") - && lstrcmpi(ext, "txt")) + && lstrcmpi(ext, "txt") + && info.uncompressed_size > 16) { // If this isn't some kind of info file, we should maybe pick it. unzGetFilePos(zipFile, &bestFile); @@ -221,8 +222,8 @@ { info.size_comment++; } - char *comment = new char[info.size_comment]; - if(unzGetGlobalComment(zipFile, comment, info.size_comment) >= 0) + char *comment = new (std::nothrow) char[info.size_comment]; + if(comment != nullptr && unzGetGlobalComment(zipFile, comment, info.size_comment) >= 0) { comment[info.size_comment - 1] = '\0'; return comment; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-15 15:25:43
|
Revision: 1461 http://sourceforge.net/p/modplug/code/1461 Author: saga-games Date: 2012-12-15 15:25:36 +0000 (Sat, 15 Dec 2012) Log Message: ----------- [Fix] Order list: Non-existing patterns above the highest existing pattern are not displayed as "???" anymore. [Imp] Pattern Editor: When using quantize together with pattern looping, quantized notes are not quantized to the follow-up pattern anymore but rather the first row of the current pattern. [Ref] Small changes. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/Load_wav.cpp trunk/OpenMPT/soundlib/SampleIO.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2012-12-14 10:13:33 UTC (rev 1460) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2012-12-15 15:25:36 UTC (rev 1461) @@ -867,9 +867,9 @@ s[0] = '\0'; if(nIndex < maxEntries && (rect.left + m_cxFont - 4) <= rcClient.right) { - if (nPat == pSndFile->Order.GetInvalidPatIndex()) strcpy(s, "---"); - else if (nPat == pSndFile->Order.GetIgnoreIndex()) strcpy(s, "+++"); - else if (nPat < pSndFile->Patterns.Size()) wsprintf(s, "%u", nPat); + if(nPat == pSndFile->Order.GetInvalidPatIndex()) strcpy(s, "---"); + else if(nPat == pSndFile->Order.GetIgnoreIndex()) strcpy(s, "+++"); + else if(nPat < Util::Max(pSndFile->Patterns.Size(), pSndFile->GetModSpecifications().patternsMax)) wsprintf(s, "%u", nPat); else strcpy(s, "???"); } @@ -1257,7 +1257,7 @@ { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - const OrdSelection selection = GetCurSel(false); + const OrdSelection selection = GetCurSel(false); const ORDERINDEX nInsertCount = selection.lastOrd - selection.firstOrd, nInsertEnd = selection.lastOrd; for(ORDERINDEX i = 0; i <= nInsertCount; i++) Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2012-12-14 10:13:33 UTC (rev 1460) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2012-12-15 15:25:36 UTC (rev 1461) @@ -5489,7 +5489,7 @@ if(!sndFile->Patterns[pat].IsValidRow(row)) { // Quantization exceeds current pattern, try stuffing note into next pattern instead. - PATTERNINDEX nextPat = GetNextPattern(); + PATTERNINDEX nextPat = sndFile->m_SongFlags[SONG_PATTERNLOOP] ? m_nPattern : GetNextPattern(); if(nextPat != PATTERNINDEX_INVALID) { pat = nextPat; Modified: trunk/OpenMPT/soundlib/Load_mid.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mid.cpp 2012-12-14 10:13:33 UTC (rev 1460) +++ trunk/OpenMPT/soundlib/Load_mid.cpp 2012-12-15 15:25:36 UTC (rev 1461) @@ -482,15 +482,15 @@ #ifdef MODPLUG_TRACKER int importSpeed = CMainFrame::GetSettings().midiImportSpeed; - int importPatternLen = CMainFrame::GetSettings().midiImportPatternLen; + ROWINDEX importPatternLen = CMainFrame::GetSettings().midiImportPatternLen; #else int importSpeed = 3; - int importPatternLen = 128; + ROWINDEX importPatternLen = 128; #endif // MODPLUG_TRACKER // Fix import parameters Limit(importSpeed, 2, 6); - Limit(importPatternLen, 64, 256); + Limit(importPatternLen, ROWINDEX(1), MAX_PATTERN_ROWS); // Detect RMI files if ((dwMemLength > 12) Modified: trunk/OpenMPT/soundlib/Load_psm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_psm.cpp 2012-12-14 10:13:33 UTC (rev 1460) +++ trunk/OpenMPT/soundlib/Load_psm.cpp 2012-12-15 15:25:36 UTC (rev 1461) @@ -1230,7 +1230,7 @@ { // volume present m.volcmd = VOLCMD_VOLUME; - m.vol = patternChunk.ReadUint8(); + m.vol = Util::Min(patternChunk.ReadUint8(), uint8(64)); } if(chnFlag & effectFlag) { Modified: trunk/OpenMPT/soundlib/Load_wav.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_wav.cpp 2012-12-14 10:13:33 UTC (rev 1460) +++ trunk/OpenMPT/soundlib/Load_wav.cpp 2012-12-15 15:25:36 UTC (rev 1461) @@ -115,6 +115,7 @@ sample.uFlags = CHN_PANNING; sample.nLength = sampleLength; sample.nC5Speed = wavFile.GetSampleRate(); + strcpy(m_szNames[channel + 1], ""); wavFile.ApplySampleSettings(sample, m_szNames[channel + 1]); if(wavFile.GetNumChannels() > 1) Modified: trunk/OpenMPT/soundlib/SampleIO.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleIO.cpp 2012-12-14 10:13:33 UTC (rev 1460) +++ trunk/OpenMPT/soundlib/SampleIO.cpp 2012-12-15 15:25:36 UTC (rev 1461) @@ -395,9 +395,9 @@ size_t SampleIO::WriteSample(FILE *f, const ModSample &sample, SmpLength maxSamples) const //---------------------------------------------------------------------------------------- { - UINT len = 0, bufcount; + size_t len = 0, bufcount = 0; char buffer[32768]; - signed char *pSample = (signed char *)sample.pSample; + int8 *pSample = (int8 *)sample.pSample; SmpLength numSamples = sample.nLength; if(maxSamples && numSamples > maxSamples) numSamples = maxSamples; @@ -406,22 +406,22 @@ if(GetBitDepth() == 16 && GetChannelFormat() == mono && GetEndianness() == littleEndian && (GetEncoding() == signedPCM || GetEncoding() == unsignedPCM || GetEncoding() == deltaPCM)) { - // 16-bit samples + // 16-bit mono samples int16 *p = (int16 *)pSample; int s_old = 0, s_ofs; len = numSamples * 2; - bufcount = 0; s_ofs = (GetEncoding() == unsignedPCM) ? 0x8000 : 0; - for (UINT j=0; j<numSamples; j++) + for(SmpLength j = 0; j < numSamples; j++) { int s_new = *p; p++; - if (sample.uFlags & CHN_STEREO) + if(sample.uFlags[CHN_STEREO]) { + // Downmix stereo s_new = (s_new + (*p) + 1) >> 1; p++; } - if (GetEncoding() == deltaPCM) + if(GetEncoding() == deltaPCM) { *((int16 *)(&buffer[bufcount])) = (int16)(s_new - s_old); s_old = s_new; @@ -430,7 +430,7 @@ *((int16 *)(&buffer[bufcount])) = (int16)(s_new + s_ofs); } bufcount += 2; - if (bufcount >= sizeof(buffer) - 1) + if(bufcount >= sizeof(buffer) - 1) { if(f) fwrite(buffer, 1, bufcount, f); bufcount = 0; @@ -516,9 +516,8 @@ else if(GetBitDepth() == 8 && GetChannelFormat() == stereoInterleaved && GetEncoding() == unsignedPCM) { - // Stereo unsigned interleaved + // Stereo unsigned interleaved len = numSamples * 2; - bufcount = 0; for (UINT j=0; j<len; j++) { *((uint8 *)(&buffer[bufcount])) = *((uint8 *)(&pSample[j])) + 0x80; @@ -536,7 +535,6 @@ else { len = numSamples; - bufcount = 0; int8 *p = (int8 *)pSample; int sinc = (sample.uFlags & CHN_16BIT) ? 2 : 1; int s_old = 0, s_ofs = (GetEncoding() == unsignedPCM) ? 0x80 : 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-15 18:41:43
|
Revision: 1463 http://sourceforge.net/p/modplug/code/1463 Author: saga-games Date: 2012-12-15 18:41:37 +0000 (Sat, 15 Dec 2012) Log Message: ----------- [Int] Fixed VS2008 project (apparently, the TR1 stuff is still required there...) Modified Paths: -------------- trunk/OpenMPT/common/misc_util.h trunk/OpenMPT/mptrack/MPTRACK_08.sln trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/soundlib/FileReader.h trunk/OpenMPT/ungzip/ungzip_08.vcproj trunk/OpenMPT/unzip/unzip_08.vcproj Modified: trunk/OpenMPT/common/misc_util.h =================================================================== --- trunk/OpenMPT/common/misc_util.h 2012-12-15 15:45:30 UTC (rev 1462) +++ trunk/OpenMPT/common/misc_util.h 2012-12-15 18:41:37 UTC (rev 1463) @@ -14,11 +14,31 @@ #include <string> #include <limits> #include "typedefs.h" -#if _HAS_TR1 - #include <type_traits> -#endif #include <io.h> // for _taccess +#if(_MSC_VER < 1600) + // has_trivial_assign for VS2008 + namespace std + { + namespace tr1 + { + template <class T> struct has_trivial_assign {static const bool value = false;}; + #define SPECIALIZE_TRIVIAL_ASSIGN(type) template <> struct has_trivial_assign<type> {static const bool value = true;} + SPECIALIZE_TRIVIAL_ASSIGN(int8); + SPECIALIZE_TRIVIAL_ASSIGN(uint8); + SPECIALIZE_TRIVIAL_ASSIGN(int16); + SPECIALIZE_TRIVIAL_ASSIGN(uint16); + SPECIALIZE_TRIVIAL_ASSIGN(int32); + SPECIALIZE_TRIVIAL_ASSIGN(uint32); + SPECIALIZE_TRIVIAL_ASSIGN(int64); + SPECIALIZE_TRIVIAL_ASSIGN(uint64); + #undef SPECIALIZE_TRIVIAL_ASSIGN + }; + }; +#else +#include <type_traits> +#endif + //Convert object(typically number) to string template<class T> inline std::string Stringify(const T& x) Modified: trunk/OpenMPT/mptrack/MPTRACK_08.sln =================================================================== --- trunk/OpenMPT/mptrack/MPTRACK_08.sln 2012-12-15 15:45:30 UTC (rev 1462) +++ trunk/OpenMPT/mptrack/MPTRACK_08.sln 2012-12-15 18:41:37 UTC (rev 1463) @@ -6,6 +6,7 @@ {44316F22-904E-48AA-B841-5A3A6AC77319} = {44316F22-904E-48AA-B841-5A3A6AC77319} {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8} = {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8} {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} = {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} + {4CEFBC84-C215-11DB-8314-0800200C9A66} = {4CEFBC84-C215-11DB-8314-0800200C9A66} {CF3C2CA5-5D45-4635-BBA4-C1F435E10896} = {CF3C2CA5-5D45-4635-BBA4-C1F435E10896} {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B} = {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B} EndProjectSection @@ -15,6 +16,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unrar", "..\unrar\unrar_08.vcproj", "{FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unzip", "..\unzip\unzip_08.vcproj", "{44316F22-904E-48AA-B841-5A3A6AC77319}" + ProjectSection(ProjectDependencies) = postProject + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} = {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xsoundlib", "..\xsoundlib\xsoundlib_08.vcproj", "{DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}" EndProject Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2012-12-15 15:45:30 UTC (rev 1462) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2012-12-15 18:41:37 UTC (rev 1463) @@ -48,7 +48,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="..\unlha;..\unzip;..\unrar;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\xsoundlib;..\" + AdditionalIncludeDirectories="..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\xsoundlib;..\" PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,ENABLE_EQ,MODPLUG_TRACKER,NO_PACKING,HAVE_DOT_NET,ENABLE_AMD,ENABLE_SSE,ENABLE_AMDNOW,ENABLE_MMX" StringPooling="true" ExceptionHandling="2" @@ -156,7 +156,7 @@ Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="2" - AdditionalIncludeDirectories="..\unlha;..\unzip;..\unrar;..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\xsoundlib;..\" + AdditionalIncludeDirectories="..\soundlib;..\include;..\include\vstsdk2.4\;..\include\ASIOSDK2\common\;..\xsoundlib;..\" PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,ENABLE_MMX,ENABLE_EQ,MODPLUG_TRACKER,NO_PACKING,HAVE_DOT_NET,ENABLE_AMD,ENABLE_SSE,ENABLE_AMDNOW" StringPooling="true" ExceptionHandling="2" Modified: trunk/OpenMPT/soundlib/FileReader.h =================================================================== --- trunk/OpenMPT/soundlib/FileReader.h 2012-12-15 15:45:30 UTC (rev 1462) +++ trunk/OpenMPT/soundlib/FileReader.h 2012-12-15 18:41:37 UTC (rev 1463) @@ -15,6 +15,7 @@ #include "Endianness.h" #include <vector> #include <algorithm> +#include <limits> //============== Modified: trunk/OpenMPT/ungzip/ungzip_08.vcproj =================================================================== --- trunk/OpenMPT/ungzip/ungzip_08.vcproj 2012-12-15 15:45:30 UTC (rev 1462) +++ trunk/OpenMPT/ungzip/ungzip_08.vcproj 2012-12-15 18:41:37 UTC (rev 1463) @@ -40,6 +40,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" + AdditionalIncludeDirectories="../include/" PreprocessorDefinitions="WIN32;ZLIB_WINAPI" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -103,6 +104,7 @@ Name="VCCLCompilerTool" Optimization="2" EnableIntrinsicFunctions="true" + AdditionalIncludeDirectories="../include/" PreprocessorDefinitions="WIN32;ZLIB_WINAPI" RuntimeLibrary="0" EnableFunctionLevelLinking="true" Modified: trunk/OpenMPT/unzip/unzip_08.vcproj =================================================================== --- trunk/OpenMPT/unzip/unzip_08.vcproj 2012-12-15 15:45:30 UTC (rev 1462) +++ trunk/OpenMPT/unzip/unzip_08.vcproj 2012-12-15 18:41:37 UTC (rev 1463) @@ -2,8 +2,8 @@ <VisualStudioProject ProjectType="Visual C++" Version="9,00" - Name="ungzip" - ProjectGUID="{94CD7910-649A-4075-9F33-7EBEE614FD45}" + Name="unzip" + ProjectGUID="{44316F22-904E-48AA-B841-5A3A6AC77319}" RootNamespace="ungzip" TargetFrameworkVersion="196613" > @@ -40,6 +40,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" + AdditionalIncludeDirectories="../include/zlib/" PreprocessorDefinitions="WIN32;ZLIB_WINAPI" MinimalRebuild="true" BasicRuntimeChecks="3" @@ -103,6 +104,7 @@ Name="VCCLCompilerTool" Optimization="2" EnableIntrinsicFunctions="true" + AdditionalIncludeDirectories="../include/zlib/" PreprocessorDefinitions="WIN32;ZLIB_WINAPI" RuntimeLibrary="0" EnableFunctionLevelLinking="true" @@ -149,7 +151,7 @@ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" > <File - RelativePath=".\ungzip.cpp" + RelativePath=".\unzip.cpp" > </File> </Filter> @@ -159,7 +161,7 @@ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > <File - RelativePath=".\ungzip.h" + RelativePath=".\unzip.h" > </File> </Filter> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-16 01:05:07
|
Revision: 1464 http://sourceforge.net/p/modplug/code/1464 Author: saga-games Date: 2012-12-16 01:05:01 +0000 (Sun, 16 Dec 2012) Log Message: ----------- [Fix] MIDI Macro letters u and v also take global / channel / instrument volume into account. There are still some things that are different from IT, and some of them will remain different: There is no point in emulating that the additionally computed volumes seem to be applied only on the next row after they were changed. [Fix] Song length detection won't affect high offset parameter anymore. [Mod] OpenMPT: Version is now 1.20.04.08 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2012-12-15 18:41:37 UTC (rev 1463) +++ trunk/OpenMPT/mptrack/version.h 2012-12-16 01:05:01 UTC (rev 1464) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 20 #define VER_MINOR 04 -#define VER_MINORMINOR 07 +#define VER_MINORMINOR 08 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-12-15 18:41:37 UTC (rev 1463) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-12-16 01:05:01 UTC (rev 1464) @@ -82,17 +82,37 @@ class GetLengthMemory { public: + + struct ChnSettings + { + double patLoop; + ROWINDEX patLoopStart; + UINT chnVol; + ModCommand::PARAM oldGlbVolSlide; + ModCommand::NOTE note; + ModCommand::INSTR instr; + ModCommand::PARAM oldParam; + uint8 hiOffset; + BYTE vol; + + ChnSettings() + { + patLoop = 0.0; + patLoopStart = 0; + chnVol = 0; + oldGlbVolSlide = 0; + note = NOTE_NONE; + instr = 0; + oldParam = 0; + hiOffset = 0; + vol = 0xFF; + } + }; + double elapsedTime; UINT musicSpeed, musicTempo; LONG glbVol; - vector<ModCommand::PARAM> oldGlbVolSlide; - vector<ModCommand::NOTE> notes; - vector<ModCommand::INSTR> instr; - vector<ModCommand::PARAM> oldParam; - vector<BYTE> vols; - vector<UINT> chnVols; - vector<double> patLoop; - vector<ROWINDEX> patLoopStart; + vector<ChnSettings> chnSettings; protected: const CSoundFile &sndFile; @@ -110,18 +130,10 @@ musicSpeed = sndFile.m_nDefaultSpeed; musicTempo = sndFile.m_nDefaultTempo; glbVol = sndFile.m_nDefaultGlobalVolume; - oldGlbVolSlide.assign(sndFile.GetNumChannels(), 0); - instr.assign(sndFile.GetNumChannels(), 0); - notes.assign(sndFile.GetNumChannels(), NOTE_NONE); - vols.assign(sndFile.GetNumChannels(), 0xFF); - oldParam.assign(sndFile.GetNumChannels(), 0); - patLoop.assign(sndFile.GetNumChannels(), 0); - patLoopStart.assign(sndFile.GetNumChannels(), 0); - - chnVols.resize(sndFile.GetNumChannels()); - for(CHANNELINDEX icv = 0; icv < sndFile.GetNumChannels(); icv++) + chnSettings.assign(sndFile.GetNumChannels(), ChnSettings()); + for(CHANNELINDEX chn = 0; chn < sndFile.GetNumChannels(); chn++) { - chnVols[icv] = sndFile.ChnSettings[icv].nVolume; + chnSettings[chn].chnVol = sndFile.ChnSettings[chn].nVolume; } } }; @@ -257,25 +269,25 @@ // Update next position nNextRow = nRow + 1; - if (!nRow) + if(!nRow) { - for(UINT ipck = 0; ipck < m_nChannels; ipck++) - memory.patLoop[ipck] = memory.elapsedTime; + for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) + memory.chnSettings[chn].patLoop = memory.elapsedTime; } ModChannel *pChn = Chn; ModCommand *p = Patterns[nPattern].GetRow(nRow); ModCommand *nextRow = nullptr; - for (CHANNELINDEX nChn = 0; nChn < m_nChannels; p++, pChn++, nChn++) if (*((DWORD *)p)) + for(CHANNELINDEX nChn = 0; nChn < GetNumChannels(); p++, pChn++, nChn++) if(!p->IsEmpty()) { if((GetType() == MOD_TYPE_S3M) && ChnSettings[nChn].dwFlags[CHN_MUTE]) // not even effects are processed on muted S3M channels continue; ModCommand::COMMAND command = p->command; ModCommand::PARAM param = p->param; ModCommand::NOTE note = p->note; - if (p->instr) { memory.instr[nChn] = p->instr; memory.notes[nChn] = NOTE_NONE; memory.vols[nChn] = 0xFF; } - if ((note >= NOTE_MIN) && (note <= NOTE_MAX)) memory.notes[nChn] = note; - if (p->volcmd == VOLCMD_VOLUME) { memory.vols[nChn] = p->vol; } + if (p->instr) { memory.chnSettings[nChn].instr = p->instr; memory.chnSettings[nChn].note = NOTE_NONE; memory.chnSettings[nChn].vol = 0xFF; } + if ((note >= NOTE_MIN) && (note <= NOTE_MAX)) memory.chnSettings[nChn].note = note; + if (p->volcmd == VOLCMD_VOLUME) { memory.chnSettings[nChn].vol = p->vol; } switch(command) { // Position Jump @@ -377,17 +389,17 @@ } else if((param & 0xF0) == 0xA0) { // High sample offset - pChn->nOldHiOffset = param & 0x0F; + memory.chnSettings[nChn].hiOffset = param & 0x0F; } else if((param & 0xF0) == 0xB0) { // Pattern Loop if (param & 0x0F) { - memory.elapsedTime += (memory.elapsedTime - memory.patLoop[nChn]) * (double)(param & 0x0F); + memory.elapsedTime += (memory.elapsedTime - memory.chnSettings[nChn].patLoop) * (double)(param & 0x0F); } else { - memory.patLoop[nChn] = memory.elapsedTime; - memory.patLoopStart[nChn] = nRow; + memory.chnSettings[nChn].patLoop = memory.elapsedTime; + memory.chnSettings[nChn].patLoopStart = nRow; } } break; @@ -402,19 +414,19 @@ // Pattern Loop if (param & 0x0F) { - memory.elapsedTime += (memory.elapsedTime - memory.patLoop[nChn]) * (double)(param & 0x0F); - nNextPatStartRow = memory.patLoopStart[nChn]; // FT2 E60 bug + memory.elapsedTime += (memory.elapsedTime - memory.chnSettings[nChn].patLoop) * (double)(param & 0x0F); + nNextPatStartRow = memory.chnSettings[nChn].patLoopStart; // FT2 E60 bug } else { - memory.patLoop[nChn] = memory.elapsedTime; - memory.patLoopStart[nChn] = nRow; + memory.chnSettings[nChn].patLoop = memory.elapsedTime; + memory.chnSettings[nChn].patLoopStart = nRow; } } break; case CMD_XFINEPORTAUPDOWN: // ignore high offset in compatible mode - if (((param & 0xF0) == 0xA0) && !IsCompatibleMode(TRK_FASTTRACKER2)) pChn->nOldHiOffset = param & 0x0F; + if(((param & 0xF0) == 0xA0) && !IsCompatibleMode(TRK_FASTTRACKER2)) memory.chnSettings[nChn].hiOffset = param & 0x0F; break; } if ((adjustMode & eAdjust) == 0) continue; @@ -441,7 +453,7 @@ break; // Set Volume case CMD_VOLUME: - memory.vols[nChn] = param; + memory.chnSettings[nChn].vol = param; break; // Global Volume case CMD_GLOBALVOLUME: @@ -451,9 +463,9 @@ // break; // } - if (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) param <<= 1; + if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) param <<= 1; // IT compatibility 16. FT2, ST3 and IT ignore out-of-range values - if (param <= 128) + if(param <= 128) { memory.glbVol = param << 1; } @@ -463,10 +475,10 @@ if(IsCompatibleMode(TRK_IMPULSETRACKER | TRK_FASTTRACKER2)) { // IT compatibility 16. Global volume slide params are stored per channel (FT2/IT) - if (param) memory.oldGlbVolSlide[nChn] = param; else param = memory.oldGlbVolSlide[nChn]; + if (param) memory.chnSettings[nChn].oldGlbVolSlide = param; else param = memory.chnSettings[nChn].oldGlbVolSlide; } else { - if (param) memory.oldGlbVolSlide[0] = param; else param = memory.oldGlbVolSlide[0]; + if (param) memory.chnSettings[0].oldGlbVolSlide = param; else param = memory.chnSettings[0].oldGlbVolSlide; } if (((param & 0x0F) == 0x0F) && (param & 0xF0)) { @@ -495,32 +507,32 @@ memory.glbVol = CLAMP(memory.glbVol, 0, 256); break; case CMD_CHANNELVOLUME: - if (param <= 64) memory.chnVols[nChn] = param; + if (param <= 64) memory.chnSettings[nChn].chnVol = param; break; case CMD_CHANNELVOLSLIDE: - if (param) memory.oldParam[nChn] = param; else param = memory.oldParam[nChn]; + if (param) memory.chnSettings[nChn].oldParam = param; else param = memory.chnSettings[nChn].oldParam; pChn->nOldChnVolSlide = param; if (((param & 0x0F) == 0x0F) && (param & 0xF0)) { - param = (param >> 4) + memory.chnVols[nChn]; + param = (param >> 4) + memory.chnSettings[nChn].chnVol; } else if (((param & 0xF0) == 0xF0) && (param & 0x0F)) { - if (memory.chnVols[nChn] > (param & 0x0F)) param = memory.chnVols[nChn] - (param & 0x0F); + if (memory.chnSettings[nChn].chnVol > (param & 0x0F)) param = memory.chnSettings[nChn].chnVol - (param & 0x0F); else param = 0; } else if (param & 0x0F) { param = (param & 0x0F) * memory.musicSpeed; - param = (memory.chnVols[nChn] > param) ? memory.chnVols[nChn] - param : 0; - } else param = ((param & 0xF0) >> 4) * memory.musicSpeed + memory.chnVols[nChn]; + param = (memory.chnSettings[nChn].chnVol > param) ? memory.chnSettings[nChn].chnVol - param : 0; + } else param = ((param & 0xF0) >> 4) * memory.musicSpeed + memory.chnSettings[nChn].chnVol; param = min(param, 64); - memory.chnVols[nChn] = param; + memory.chnSettings[nChn].chnVol = param; break; } } - if (nNextRow >= Patterns[nPattern].GetNumRows()) + if(nNextRow >= Patterns[nPattern].GetNumRows()) { nNextOrder = nCurrentOrder + 1; nNextRow = 0; @@ -562,30 +574,31 @@ // IT compatibility 16. Global volume slide params are stored per channel (FT2/IT) for(CHANNELINDEX n = 0; n < GetNumChannels(); n++) { - Chn[n].nOldGlobalVolSlide = memory.oldGlbVolSlide[n]; + Chn[n].nOldGlobalVolSlide = memory.chnSettings[n].oldGlbVolSlide; } } else { - m_nOldGlbVolSlide = memory.oldGlbVolSlide[0]; + m_nOldGlbVolSlide = memory.chnSettings[0].oldGlbVolSlide; } m_nMusicSpeed = memory.musicSpeed; m_nMusicTempo = memory.musicTempo; for(CHANNELINDEX n = 0; n < GetNumChannels(); n++) { - Chn[n].nGlobalVol = memory.chnVols[n]; - if(memory.notes[n] != NOTE_NONE) + Chn[n].nOldHiOffset = memory.chnSettings[n].hiOffset; + Chn[n].nGlobalVol = memory.chnSettings[n].chnVol; + if(memory.chnSettings[n].note != NOTE_NONE) { - Chn[n].nNewNote = memory.notes[n]; - if(ModCommand::IsNote(memory.notes[n])) + Chn[n].nNewNote = memory.chnSettings[n].note; + if(ModCommand::IsNote(memory.chnSettings[n].note)) { - Chn[n].nLastNote = memory.notes[n]; + Chn[n].nLastNote = memory.chnSettings[n].note; } } - if(memory.instr[n]) Chn[n].nNewIns = memory.instr[n]; - if(memory.vols[n] != 0xFF) + if(memory.chnSettings[n].instr) Chn[n].nNewIns = memory.chnSettings[n].instr; + if(memory.chnSettings[n].vol != 0xFF) { - if(memory.vols[n] > 64) memory.vols[n] = 64; - Chn[n].nVolume = memory.vols[n] * 4; + if(memory.chnSettings[n].vol > 64) memory.chnSettings[n].vol = 64; + Chn[n].nVolume = memory.chnSettings[n].vol * 4; } } } else if(adjustMode != eAdjustOnSuccess) @@ -3606,11 +3619,17 @@ } } else if(macro[pos] == 'v') // v: velocity { - data = (unsigned char)min(pChn->nVolume / 2, 127); - + // This is "almost" how IT does it - apparently, IT seems to lag one row behind on global volume or channel volume changes. + const int swing = (IsCompatibleMode(TRK_IMPULSETRACKER) || GetModFlag(MSF_OLDVOLSWING)) ? pChn->nVolSwing : 0; + const int vol = _muldiv((pChn->nVolume + swing) * m_nGlobalVolume, pChn->nGlobalVol * pChn->nInsVol, 1 << 20); + data = (unsigned char)Util::Min(vol / 2, 127); + //data = (unsigned char)min((pChn->nVolume * pChn->nGlobalVol * m_nGlobalVolume) >> (1 + 6 + 8), 127); } else if(macro[pos] == 'u') // u: volume (calculated) { - data = (unsigned char)min(pChn->nCalcVolume >> 7, 127); + // Same note as with velocity applies here, but apparently also for instrument / sample volumes? + const int vol = _muldiv(pChn->nCalcVolume * m_nGlobalVolume, pChn->nGlobalVol * pChn->nInsVol, 1 << 26); + data = (unsigned char)Util::Min(vol / 2, 127); + //data = (unsigned char)min((pChn->nCalcVolume * pChn->nGlobalVol * m_nGlobalVolume) >> (7 + 6 + 8), 127); } else if(macro[pos] == 'x') // x: pan set { data = (unsigned char)min(pChn->nPan / 2, 127); Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2012-12-15 18:41:37 UTC (rev 1463) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2012-12-16 01:05:01 UTC (rev 1464) @@ -1999,11 +1999,9 @@ if (samplePlaying || plugAssigned) { int vol = pChn->nVolume; + int insVol = pChn->nInsVol; // This is the "SV * IV" value in ITTECH.TXT - if(!IsCompatibleMode(TRK_IMPULSETRACKER)) - { - ProcessVolumeSwing(pChn, vol); - } + ProcessVolumeSwing(pChn, IsCompatibleMode(TRK_IMPULSETRACKER) ? insVol : vol); ProcessPanningSwing(pChn); ProcessTremolo(pChn, vol); ProcessTremor(pChn, vol); @@ -2040,22 +2038,16 @@ // vol is 14-bits if (vol) { - int insVol = pChn->nInsVol; // This is the "SV * IV" value in ITTECH.TXT - if(IsCompatibleMode(TRK_IMPULSETRACKER)) - { - ProcessVolumeSwing(pChn, insVol); - } - // IMPORTANT: pChn->nRealVolume is 14 bits !!! // -> _muldiv( 14+8, 6+6, 18); => RealVolume: 14-bit result (22+12-20) - // Don't let global volume affect level of sample if - // Global volume is going to be applied to master output anyway. if(pChn->dwFlags[CHN_SYNCMUTE]) { pChn->nRealVolume = 0; } else if (m_pConfig->getGlobalVolumeAppliesToMaster()) { + // Don't let global volume affect level of sample if + // Global volume is going to be applied to master output anyway. pChn->nRealVolume = _muldiv(vol * MAX_GLOBAL_VOLUME, pChn->nGlobalVol * insVol, 1 << 20); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-20 00:41:51
|
Revision: 1468 http://sourceforge.net/p/modplug/code/1468 Author: saga-games Date: 2012-12-20 00:41:45 +0000 (Thu, 20 Dec 2012) Log Message: ----------- [Imp] Sample Editor: If no sample filename is specified in IT/S3M/MPTM modules, the sample name is used for suggesting a filename when saving a sample. [Imp] Sample Editor: Added hidden INI setting "FLACCompressionLevel" in [Sample Editor] to set the compression level (0...8) when saving WAV samples. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2012-12-20 00:24:17 UTC (rev 1467) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2012-12-20 00:41:45 UTC (rev 1468) @@ -1028,7 +1028,7 @@ { if(!m_pSndFile) return; - TCHAR szFileName[_MAX_PATH]; + TCHAR szFileName[_MAX_PATH] = ""; bool doBatchSave = CMainFrame::GetInputHandler()->ShiftPressed(); bool defaultFLAC = false; @@ -1043,7 +1043,8 @@ if(m_pSndFile->GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) { strncpy(szFileName, m_pSndFile->GetSample(m_nSample).filename, Util::Min(CountOf(m_pSndFile->GetSample(m_nSample).filename), CountOf(szFileName) - 1)); - } else + } + if(!szFileName[0]) { strncpy(szFileName, m_pSndFile->m_szNames[m_nSample], Util::Min(CountOf(m_pSndFile->m_szNames[m_nSample]), CountOf(szFileName) - 1)); } Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2012-12-20 00:24:17 UTC (rev 1467) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2012-12-20 00:41:45 UTC (rev 1468) @@ -2140,8 +2140,11 @@ FLAC__stream_encoder_set_sample_rate(encoder, sample.GetSampleRate(GetType())); FLAC__stream_encoder_set_total_samples_estimate(encoder, sample.nLength); FLAC__stream_encoder_set_metadata(encoder, metadata, writeLoopData ? 3 : 2); - // TODO custom compression level (0...8) - //FLAC__stream_encoder_set_compression_level(encoder, ); +#ifdef MODPLUG_TRACKER + // Custom compression level (0...8) + static const int compression = CMainFrame::GetPrivateProfileLong("Sample Editor", "FLACCompressionLevel", 5, theApp.GetConfigFileName()); + FLAC__stream_encoder_set_compression_level(encoder, compression); +#endif // MODPLUG_TRACKER if(FLAC__stream_encoder_init_file(encoder, lpszFileName, nullptr, nullptr) != FLAC__STREAM_ENCODER_INIT_STATUS_OK) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-21 18:34:42
|
Revision: 1469 http://sourceforge.net/p/modplug/code/1469 Author: saga-games Date: 2012-12-21 18:34:13 +0000 (Fri, 21 Dec 2012) Log Message: ----------- [Fix] Sample Map: New improved behaviour didn't behave as intended when removing sample assignments (http://bugs.openmpt.org/view.php?id=244#c1006) [Fix] Pattern loops on muted S3M channels were still being processed. [Fix] Accidentally broke loading of MMCMP/PP20/XPK-packed modules some revisions ago. [Mod] OpenMPT: Version is now 1.20.04.09 Modified Paths: -------------- trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2012-12-20 00:41:45 UTC (rev 1468) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2012-12-21 18:34:13 UTC (rev 1469) @@ -992,19 +992,29 @@ if(mouseAction == mouseUnknown) { // Mouse down -> decide if we are going to set or remove notes - mouseAction = (KeyboardMap[iNote] == nSample) ? mouseUnset : mouseSet; + mouseAction = mouseSet; + if(KeyboardMap[iNote] == nSample) + { + mouseAction = (KeyboardMap[iNote] == pIns->Keyboard[iNote]) ? mouseZero : mouseUnset; + } } - if(mouseAction == mouseUnset) + switch(mouseAction) { - if(KeyboardMap[iNote] == pIns->Keyboard[iNote]) + case mouseSet: + KeyboardMap[iNote] = nSample; + break; + case mouseUnset: + KeyboardMap[iNote] = pIns->Keyboard[iNote]; + break; + case mouseZero: + if(KeyboardMap[iNote] == nSample) + { KeyboardMap[iNote] = 0; - else - KeyboardMap[iNote] = pIns->Keyboard[iNote]; - } else - { - KeyboardMap[iNote] = nSample; + } + break; } + /* rewbs.note: I don't think we need this with cust keys. // -> CODE#0009 // -> DESC="instrument editor note play & octave change" Modified: trunk/OpenMPT/mptrack/dlg_misc.h =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.h 2012-12-20 00:41:45 UTC (rev 1468) +++ trunk/OpenMPT/mptrack/dlg_misc.h 2012-12-21 18:34:13 UTC (rev 1469) @@ -179,6 +179,7 @@ mouseUnknown, // Didn't mouse-down yet mouseSet, // Set selected sample mouseUnset, // Unset (revert to original keymap) + mouseZero, // Set to zero }; CKeyboardControl m_Keyboard; Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2012-12-20 00:41:45 UTC (rev 1468) +++ trunk/OpenMPT/mptrack/version.h 2012-12-21 18:34:13 UTC (rev 1469) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 20 #define VER_MINOR 04 -#define VER_MINORMINOR 08 +#define VER_MINORMINOR 09 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-12-20 00:41:45 UTC (rev 1468) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-12-21 18:34:13 UTC (rev 1469) @@ -1641,10 +1641,10 @@ } else if(m_SongFlags[SONG_FIRSTTICK]) { // Pattern Loop ? - if ((((param & 0xF0) == 0x60) && (cmd == CMD_MODCMDEX)) - || (((param & 0xF0) == 0xB0) && (cmd == CMD_S3MCMDEX))) + if((((param & 0xF0) == 0x60 && cmd == CMD_MODCMDEX) + || ((param & 0xF0) == 0xB0 && cmd == CMD_S3MCMDEX)) + && !(GetType() == MOD_TYPE_S3M && ChnSettings[nChn].dwFlags[CHN_MUTE])) // not even effects are processed on muted S3M channels { - ROWINDEX nloop = PatternLoop(pChn, param & 0x0F); if (nloop != ROWINDEX_INVALID) { @@ -4366,7 +4366,7 @@ if (param) { // Loop Repeat - if (pChn->nPatternLoopCount) + if(pChn->nPatternLoopCount) { // There's a loop left pChn->nPatternLoopCount--; @@ -4383,7 +4383,7 @@ } } else { - // This was the last loop + // First time we get into the loop => Set loop count. // IT compatibility 10. Pattern loops (+ same fix for XM / MOD / S3M files) if(!IsCompatibleMode(TRK_IMPULSETRACKER | TRK_FASTTRACKER2 | TRK_PROTRACKER | TRK_SCREAMTRACKER)) @@ -4391,8 +4391,8 @@ ModChannel *p = Chn; for(CHANNELINDEX i = 0; i < GetNumChannels(); i++, p++) if (p != pChn) { - // Loop already done - if (p->nPatternLoopCount) return ROWINDEX_INVALID; + // Loop on other channel + if(p->nPatternLoopCount) return ROWINDEX_INVALID; } } pChn->nPatternLoopCount = param; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2012-12-20 00:41:45 UTC (rev 1468) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2012-12-21 18:34:13 UTC (rev 1469) @@ -594,6 +594,10 @@ #ifdef MMCMP_SUPPORT BOOL bMMCmp = MMCMP_Unpack(&lpStream, &dwMemLength); + if(bMMCmp) + { + file = FileReader(reinterpret_cast<const char*>(lpStream), dwMemLength); + } #endif if(!ReadXM(file) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-22 18:20:14
|
Revision: 1472 http://sourceforge.net/p/modplug/code/1472 Author: saga-games Date: 2012-12-22 18:19:58 +0000 (Sat, 22 Dec 2012) Log Message: ----------- [Mod] Updated release notes documents. [Mod] OpenMPT: Version is now 1.21.01.00 Modified Paths: -------------- trunk/OpenMPT/installer/packageTemplate/readme.txt trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/readme.txt Added Paths: ----------- trunk/OpenMPT/packageTemplate/OMPT_1.21_ReleaseNotes.html trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21/ trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21/treeview.png Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/installer/packageTemplate/readme.txt 2012-12-22 15:48:48 UTC (rev 1471) +++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2012-12-22 18:19:58 UTC (rev 1472) @@ -1,5 +1,5 @@ ****************** -* OpenMPT 1.20 * +* OpenMPT 1.21 * ****************** Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2012-12-22 15:48:48 UTC (rev 1471) +++ trunk/OpenMPT/packageTemplate/History.txt 2012-12-22 18:19:58 UTC (rev 1472) @@ -18,14 +18,76 @@ <rf> rewbs / Robin Fernandes [rewbs] <sp> pelya / Sergiy Pylypenko [pelya] <tn> plastik_s / Trevor Nunes [plastik_s] -Patch submitters: +Patch submitters: <cm> kode54 / Chris Moeller <ih> xaimus / Imran Hameed <ks> coda / Ken Snyder -v1.20.04.00 (October 2012, revision 1398) ------------------------------------------ +v1.21.01.00 (22 December 2012, revision 1472) +--------------------------------------------- +Pattern tab + [New] <js> Added option to quantize notes that are recorded live (select from context menu or shortcut). + [New] <js> Added "Data Entry" shortcuts to increase or decrease the value of the currently selected pattern cells (note, instrument, effect parameters), either by +/- 1 or by a coarse value depending on the column. + [Imp] <js> If no selection has been made, interpolation shortcuts now interpolate between the nearest notes / instruments / commands above and below the cursor position. + [Imp] <js> Added shortcuts for Record Select / Split Record Select (tx DJBouche). + [Fix] <js> Resizing a pattern only created an undo point when the pattern was reduced. + [Fix] <js> Set Instrument also works if "No Instrument" is chosen (http://forum.openmpt.org/index.php?topic=4178.0). + [Fix] <js> Non-existing patterns above the highest existing pattern are not displayed as "???" in the order list anymore. + +Sample tab + [New] <js> Can now load and save FLAC samples. + [New] <js> Added new stereo to mono sample conversion modes: Keep only left / right channel, split stereo sample into two mono samples. + [Imp] <js> Added shortcuts for "Zoom into Selection" (http://forum.openmpt.org/index.php?topic=4877.0), 8-bit and mono conversion. + [Imp] <js> When triggering a note, the note frequency is displayed next to the note name in the status bar. + [Imp] <js> It is now possible to drag and drop multiple samples from explorer. + [Imp] <js> When saving a sample, the actual sample is now suggested if no sample filename is specified in IT / S3M / MPTM modules. + [Imp] <js> Added hidden INI setting "DefaultFormat" in the [Sample Editor] section to specify the default format to use when saving samples (possible values: wav, flac, raw). + [Imp] <js> Added hidden INI setting "FLACCompressionLevel" in the [Sample Editor] section to set the compression level (0...8) when saving FLAC samples. + [Fix] <js> Reducing the size of the sample undo buffer could sometimes lead to freezes (http://bugs.openmpt.org/view.php?id=314). + [Fix] <js> Fixed a possible crash when creating undo points (e.g. when using loop crossfade). + [Fix] <js> Saved WAV files should now finally have a file size in the header. + +Instrument tab + [Imp] <js> Moving the envelope tail (using Ctrl + Drag) also works properly if the distance between the moved point and the following point is small. + [Imp] <js> It is now possible to drag and drop multiple instruments from explorer. + [Imp] <js> Dragging the mouse over the sample map doesn't invert every note's assignment but applies the same action to all notes now (http://bugs.openmpt.org/view.php?id=244). + [Fix] <js> Importing DLS / SF2 samples into the sample editor does now properly remove sample attributes not supported by the current format. + +Tree view + [Fix] <js> Rearrange samples / instruments was really buggy. + +MIDI Macros + [Fix] <js> MIDI Macro letters u and v also take global / channel / instrument volume into account. + [Fix] <js> Zxx is now only applied on first tick (like in Impulse tracker), before any other effects, \xx remains "sane" and is applied on every tick. + +VST / DMO Plugins + [Imp] <js> The Preset menu in the plugin editor is now filled on demand (when clicking it for the first time) to keep the GUI responsive when opening the editor of plugins that have many presets. + [Fix] <js> Changing the preset from the plugin editor didn't mark the module as modified (http://bugs.openmpt.org/view.php?id=317). + +Playback + [Fix] <js> Reverse pattern loops that are obfuscated through pattern jump commands should now also work correctly when "Loop Song" is off and during Wave Export (http://bugs.openmpt.org/view.php?id=311). + +XM::Compatible Playback Mode + [Fix] <js> Volume column lxx / rxx doesn't overwrite the effect memory of Pxy anymore. + +XM::Loading and Saving + [Fix] <js> Importing patterns >= 240 didn't work in OpenMPT 1.20.04.00 (http://bugs.openmpt.org/view.php?id=308). + [Fix] <js> XM instrument saving failed in all versions of OpenMPT 1.20 if there were samples in the sample map that were only referenced below C-1 or above B-8 (http://bugs.openmpt.org/view.php?id=324). + +S3M + [Fix] <js> Pattern loops on muted S3M channels were still being processed. + +Misc + [Imp] <js> Added possible fix for some SF2 inaccuracies (tx BeRo). + [Imp] <js> Added basic support for DLS Level 2 regions (they are just treated like DLS Level 1 regions). + [Fix] <js> Fixed crash when loading some DLS samples. + [Fix] <js> Fixed possible integer overflow when reading song messages from files. + [Fix] <js> Song length detection won't affect actually stored high offset parameter anymore. + + +v1.20.04.00 (27 October 2012, revision 1398) +-------------------------------------------- General tab [Fix] <js> Input boxes in general tab didn't allow for horizontal scrolling. @@ -37,6 +99,9 @@ [Fix] <js> Loading XI files as samples could lead to a crash (tx Lucas). [Fix] <js> Mass sample export file names were sometimes not sanitized correctly (http://bugs.openmpt.org/view.php?id=300). +Treev iew + [New] <js> It is now possible to rearrange (drag and drop), insert and duplicate (through the context menu) samples and instruments. + VST / DMO Plugins [Fix] <js> Plugin Selection Dialog: Adding new plugins didn't focus them as intended. [Fix] <js> Plugin Editor: Bypassing a plugin from its editor didn't mark the module as modified. @@ -46,7 +111,7 @@ XM::Compatible Playback Mode [Fix] <js> Improved XM tremor effect compatibility. - + XM::Loading and Saving [Imp] <js> Full tempo range (32 - 512) is now also supported for the default tempo in compatibility export, as Fasttracker 2 actually "supports" this (not through the GUI, but it won't sanitize such values in files) and XMPlay also does. [Imp] <js> Improved detection of files made with MPT. @@ -58,7 +123,6 @@ [Fix] <js> ITP Saver: ITP files saved with OpenMPT 1.20.03.00 were corrupted. Files saved with this version can be fixed by writing the byte sequence 10 00 02 (hex) at position $2B (instead of 01 00 00). Misc - [New] <js> Tree View: It is now possible to rearrange (drag and drop), insert and duplicate (through the context menu) samples and instruments. [New] <js> Added hidden INI setting ASIOBaseChannel in [Sound Settings] category to specify the first ASIO channel to use for sound output (as a quick and dirty semi-solution for http://bugs.openmpt.org/view.php?id=128). [Imp] <js> Using the mouse wheel to scroll edit controls with spin buttons works on all such controls now (http://bugs.openmpt.org/view.php?id=99). [Mod] <js> Changed default resampling type to XMMS-ModPlug. @@ -99,7 +163,7 @@ [Fix] <js> A memory leak that occoured when trying to register invalid or missing plugins (e.g. on startup) has been fixed. IT::Compatible Playback Mode - [Fix] <js> A channel's key-off status is kept with portamento notes if "Compatible Gxx" is disabled or there is no instrument number next to the new note. + [Fix] <js> A channel's key-off status is kept with portamento notes if "Compatible Gxx" is disabled or there is no instrument number next to the new note. IT::Loading [Fix] <js> Overly long (26 characters) sample / instrument name strings found in IT files made with older versions of MPT are now read correctly again. @@ -174,7 +238,7 @@ IT::Compatible Playback Mode [Fix] <js> Combinations of Qxy (retrigger) with a pattern delay at Speed y should now work as intended. - [Fix] <js> Combinations of SDx with x greater than the current speed combined with tick delay commands didn't work. + [Fix] <js> Combinations of SDx with x greater than the current speed combined with tick delay commands didn't work. IT::Loading [Fix] <js> Loading IT files made with older versions of OpenMPT replaces SC0 with ^^ instead of v00 now. @@ -197,7 +261,7 @@ [New] <js> AMS (Velvet Studio) support is finally back (not crashing the tracker this time :). AMS (Extreme's Tracker) support has been improved as well. [Imp] <js> WAV Loader also imports loop points when reading a WAV file as a module. [Imp] <js> STM Loader imports some effects more correctly now. - [Imp] <js> UMX Loader checks for a few more contained module formats that are also supported by Galaxy Sound System (STM, 669, FAR). + [Imp] <js> UMX Loader checks for a few more contained module formats that are also supported by Galaxy Sound System (STM, 669, FAR). [Fix] <js> MDL Loader was severely broken in OpenMPT 1.20.01.00. [Fix] <js> MED Loader: Sample transpose should work as intended (at least for MMD1 modules), MMD2 order list works again as well, Tempo vs Speed precedence for value 32 should be correct now. @@ -216,7 +280,7 @@ General tab [Imp] <js> Like the plugin preset box, the plugin parameter selection box is now only populated when it is focussed, to avoid delays with plugins that have tons of parameters. [Imp] <js> Default global volume display is now limited to 0...64 (instead of 0...128) for S3M (http://forum.openmpt.org/index.php?topic=4658.0). - [Mod] <js> Default global volume is not available anymore in the XM format, since it is not supported by the original format. + [Mod] <js> Default global volume is not available anymore in the XM format, since it is not supported by the original format. [Fix] <js> Switching between plugin presets didn't update the plugin parameter display. [Fix] <js> When enabling surround for a channel, panning was not reset properly for playing tracks. @@ -296,7 +360,7 @@ [Fix] <js> Loading instruments from other modules is no longer limited to 32 samples. [Fix] <js> Fixed possible stack corruption when loading instruments into XM files. -Treeview +Tree view [Imp] <js> The limit of 32 displayed song items has been removed. [Imp] <js> If available, drum keys use key names provided by the soundfont instead of pre-defined drum key names. [Imp] <js> All supported module files are now shown in the directory browser by default, even if "Show All Files" is disabled. @@ -319,7 +383,7 @@ VST / DMO Plugins [New] <js> Plugins can now send MIDI events to chained plugins. Useful for e.g. LFO or arpeggiator plugins. [New] <js> Added "mappped" MIDI channels (like in Impulse Tracker). If a plugin's MIDI Channel is set to "mapped" in the instrument editor, note data is transmitted on a triggered note's pattern channel modulo 16. - [New] <js> Experimental built-in support for JBridge. If you run OpenMPT with admin privileges now, you can directly run 64-Bit VST plugins in OpenMPT. + [New] <js> Experimental built-in support for JBridge. If you run OpenMPT with admin privileges now, you can directly run 64-Bit VST plugins in OpenMPT. [Imp] <js> Rewrote default plugin editor (the one that is used for plugins with no custom GUI). Multiple parameters are shown at the same time, with the same automation functionality as custom editors (record to pattern, automatic MIDI Mapping by pressing Shift, etc...), remembers window position, etc... (http://forum.openmpt.org/index.php?topic=1974.0) [Imp] <js> Searching for multiple unknown plugins will now open only one browser window. [Imp] <js> Named DMO parameter values are now displayed properly. @@ -417,7 +481,7 @@ XM::Loading and Saving [Imp] <js> Volume Column panning is now scaled better when loading or saving XM files, so it is translated to a 0...64 range instead of 2...62. [Imp] <js> Saving: Samples that are not associated to any instrument are now tried to be written to XM files anyway (http://bugs.openmpt.org/view.php?id=234). - [Mod] <js> Some compatibility settings are now always applied (not only in XM compatible mode) and files saved with older versions of OpenMPT are "fixed" automatically to still work with the new settings. Affected settings are: Out-of-range global volume handling, portamento vs. offset priority. + [Mod] <js> Some compatibility settings are now always applied (not only in XM compatible mode) and files saved with older versions of OpenMPT are "fixed" automatically to still work with the new settings. Affected settings are: Out-of-range global volume handling, portamento vs. offset priority. [Fix] <js> Saving: When saving an XM with no instruments, garbage instrument settings were written. S3M @@ -578,7 +642,7 @@ --------------------------------------- Pattern tab [New] <js> Channels can now be moved by dragging their channel header. Holding Shift while doing so duplicates the channel. - [Imp] <js> Moving channels through the channel manager creates an undo point now. + [Imp] <js> Moving channels through the channel manager creates an undo point now. [Fix] <js> Order list info text now truncates list length after the first "---" pattern for MOD files in hex display mode as well. Pattern tab::Note properties @@ -719,14 +783,14 @@ [Fix] <js> Various fixes to playback of multi-sample instruments. "Ultima Ratio" by Nebularia and "Shuttle Departure" by Sphenx sound better now. IT::Loading and Saving - [New] <js> Edit history information can now be read from and saved to IT / MPTM files. This is based on an undocumented feature in Impulse Tracker. Use View -> Edit History for viewing or deleting this information. + [New] <js> Edit history information can now be read from and saved to IT / MPTM files. This is based on an undocumented feature in Impulse Tracker. Use View -> Edit History for viewing or deleting this information. [Imp] <js> Autovibrato sweep is now fixed when loading IT files made with old versions of (Open)MPT. [Imp] <js> IT files made with Modplug Tracker 1.00a5 are now also detected as such. Since long patterns can also be created in other trackers (e.g. Chibi), long patterns are not used to identify files made with MPT anymore. - [Mod] <js> MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker). + [Mod] <js> MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker). [Mod] <js> Sane values are used again for the "cwtv" and "cmwt" header fields when saving IT files; in fact the same values as in compatibility export are used. To be able to distinguish between raped and compatibility-exported IT files, "OMPT" is written in the "reserved" header field. As a consequence, IT files made with OpenMPT can now be loaded in Impulse Tracker again. [Fix] <js> Note mapping items that aren't notes (e.g. empty notes) are now ignored when loading and saving. [Fix] <js> When saving, non-existing envelopes are now replaced by a default (disabled) envelope, so that they can still be edited in Impulse Tracker. - [Fix] <js> The extended sample map is not saved anymore in the instrument headers when using compatibility export. + [Fix] <js> The extended sample map is not saved anymore in the instrument headers when using compatibility export. MPTM [New] <js> Each pattern can now have a custom time signature (rows per beat and rows per measure) which can be set from the pattern properties dialog (http://forum.openmpt.org/index.php?topic=4022.0). @@ -791,7 +855,7 @@ [Fix] <js> Mod Cleanup: Various sample / instrument rearranging functions broke Parameter Control Events. [Fix] <js> The text length was calculated wrong in the message reader, leading to a possible buffer overflow when reading song messages with mixed line endings where CR or LF line endings were expected. [Fix] <js> When there was no INI file, the size of the upper pattern view was defaulting to a wrong value. - [Fix] <js> The ID3v2 "comments" field was not formatted properly when exporting to MP3. + [Fix] <js> The ID3v2 "comments" field was not formatted properly when exporting to MP3. [Fix] <js> unmo3.dll and uxtheme.dll (for theming the general tab) are now loaded "safely", to avoid the currently spreading DLL exploits. [Fix] <js> Editing a sample / instrument name on the comments tab didn't mark the module as modified (tx djmakas) [Fix] <js> When changing the font size of the song message while the comments tab is open, the message editor is now resized instantly. Previously, only the font size was updated. @@ -811,13 +875,13 @@ Pattern tab::pattern editing [Imp] <js> Just like in MPT 1.16, it is now possible again to interpolate between an effect and "nothing". In that case, the same value as the already existing one is repeated between the two rows. [Fix] <js> When the first column of a pattern selection (larger than one selection field) was the parameter column, Parameter Control Event values in this column were not reset properly. - [Fix] <js> Pattern Editor: Transposing notes up/down doesn't allow notes which are actually supported by the current module format (e.g. notes below C-1 in XMs) anymore. + [Fix] <js> Transposing notes up / down doesn't allow notes which are actually not supported by the current module format (e.g. notes below C-1 in XMs) anymore. [Fix] <js> Keyboard shortcut for toggling record state didn't save the change, so it was reset with every new module. Pattern tab::Note properties [Imp] <js> Effect info now shows the real finetune values for E5x in MOD/XM and E2x in S3M instead of just 0...15. [Imp] <js> Set envelope position effect (Lxx in XM) is now explained better. - [Fix] <js> Fixed a null pointer related crash when accessing the note properties of malicious and not-so-malicious modules (e.g. jt_pools.xm) which have more than 256 sample slots. + [Fix] <js> Fixed a crash when accessing the note properties of malicious and not-so-malicious modules (e.g. jt_pools.xm) which have more than 256 sample slots. Sample tab [New] <js> It's now also possible to create sample selections using Shift + click (this is still behaving a bit non-obvious if you don't know what you're doing :). @@ -836,9 +900,9 @@ [Imp] <js> When pasting an envelope with a release node, it's now ignored in formats that don't support it. [Reg] <js> Envelope release nodes cannot be enabled for IT files anymore, but they are still played for compatibility (One has to start removing the crap from the old formats at some point...). -Treeview - [Imp] <js> Treeview: Ask for confirmation when deleting patterns, samples, instruments, sequences. - [Fix] <js> Deleting a sample from the treeview and then applying undo for this sample in the sample editor crashed OpenMPT. +Tree view + [Imp] <js> Ask for confirmation when deleting patterns, samples, instruments, sequences. + [Fix] <js> Deleting a sample from the tree view and then applying undo for this sample in the sample editor crashed OpenMPT. Mod conversion [Imp] <js> Some improvements with converting note cuts, ECx/SCx and EDx/SDx. @@ -877,7 +941,7 @@ [Imp] <js> PSM Loader: Small improvements. [Fix] <js> MTM Loader: The "beats per track" (means lines per pattern) setting is now taken into account. [Fix] <js> PSM16 Loader: Since the control channels were muted, tempo commands were ignored, effectively slowing down some PSM16 tracks. - [Fix] <al> MPTM Saver: When deleting patterns using the treeview, it was possible that Parameter Control Notes were not saved properly anymore. + [Fix] <al> MPTM Saver: When deleting patterns using the tree view, it was possible that Parameter Control Notes were not saved properly anymore. Misc [New] <js> Experimental "panic" button on the main toolbar. At the moment, it just kills all VSTi and sample voices. @@ -904,7 +968,7 @@ [Imp] <js> The sequence menu also allows to insert empty sequences now. [Fix] <js> Jumping between patterns also stops VSTi notes now. -Pattern tab::pattern editing +Pattern tab::Pattern editing [New] <js> Extended context menu for Parameter Control Events. [New] <js> Key shortcut + context menu entry for toggling the plugin editor of the Parameter Control Event that's under the cursor. [Imp] <js> Overflow paste now only uses one undo step. @@ -916,7 +980,7 @@ [Fix] <js> When pasting pattern data that exactly reached the pattern end with overflow paste enabled, a redundant undo point was created. [Fix] <js> Entered (volume) effects are now properly validated (makes a difference e.g. in MOD format where it was previously possible to enter effects like Hxx) [Fix] <js> Mix Paste: When in MPT behaviour mode, empty FX commands were not overwritten properly when there previously was an effect in that field but only the effect number (and not the param value) was reset. - [Fix] <js> When deleting all patterns via the treeview and then switching to the pattern editor, pattern 0 is not created automatically anymore, to avoid confusion. + [Fix] <js> When deleting all patterns via the tree view and then switching to the pattern editor, pattern 0 is not created automatically anymore, to avoid confusion. [Reg] <js> Creating a selection using the Shift key + Mouse click now only works if there was previously no selection made; This seems reasonable as the old shift - behaviour seems to be widely used. Pattern tab::GUI @@ -963,11 +1027,11 @@ [Fix] <js> Correct C-5 frequency is now also shown for XM modules. [Fix] <js> When editing sample / instrument names, they are limited properly in length now. -Treeview +Tree view [New] <js> Sequences can now be copied to other modules by simply dragging the sequence header into the the other module's sequence header. Does only work between two different modules, not within the same module, and it will not copy the pattern contents. [Imp] <js> Display sequence index next to sequence names. [Imp] <js> Improved order dragging; It is now also possible to drag an order into a non-MPTM module. In that case, the old orderlist will be replaced. - [Imp] <js> J2B files were not shown in the treeview. + [Imp] <js> J2B files were not shown in the tree view. [Fix] <js> Soundfont samples were not playing correctly anymore. Note that soundfont samples in the MIDI library still don't work. [Fix] <js> A crash could occour if the instrument library path was too long (e.g. because of malicious strings in the [Paths] section of the INI file) [Fix] <js> "Bypass" action for plugins didn't set the document as modified. @@ -989,7 +1053,7 @@ [Fix] <js> When converting from MOD to S3M or IT, the Invert Loop effect was not removed. [Fix] <js> When converting from MPTM to another format, the first sequence name is removed and the sequence is now sized properly when merging multiple sequences (tx Skaven). [Fix] <js> When converting between XM and IT, the sample autovibrato "sweep" factor is now fixed a bit (since sweep = 0 equals "no sweep" in XM, and "no vibrato" in IT). - [Fix] <js> When removing instruments from the treeview and converting the module to a different format which also supports instruments, OpenMPT crashed. + [Fix] <js> When removing instruments from the tree view and converting the module to a different format which also supports instruments, OpenMPT crashed. [Fix] <js> When converting to MOD/S3M, the extended filter range flag was not deactivated. [Fix] <js> S00 (IT/S3M) does not equal E00 (MOD/XM), as Exx doesn't have effect memory. Trying to convert S00 to the last used value now. [Fix] <js> If necessary (S3M), the restart position attribute is reset. @@ -1033,10 +1097,10 @@ S3M [Imp] <js> Loading: Display a message if an S3M file contains Adlib instruments (rare). [Fix] <js> In ST3, muted channels are completely ignored, not even effects are interpreted. Let's try this in MPT, too. - [Fix] <js> S3M Compatibility: Slightly better handling of vibrato/tremolo waveform types (although the ST3 help screen says that continuous vibrato/tremolo is possible, it does actually not work.) + [Fix] <js> Slightly better handling of vibrato/tremolo waveform types (although the ST3 help screen says that continuous vibrato/tremolo is possible, it does actually not work.) [Reg] <js> Cannot create S3M files with more than 100 patterns anymore, because... [Fix] <js> ... it was possible to create S3M files where the 256 parapointers were not enough, resulting in incomplete/broken files. - [Fix] <js> S3M Compatibility: Note Cut really cuts notes and does not just mute them (so that following volume commands could restore the sample) + [Fix] <js> Note Cut really cuts notes and does not just mute them (so that following volume commands could restore the sample) MPTM [New] <rf> Added combined note delay & note cut command for MPTM only (":xy" means delay until tick x and play for y ticks). @@ -1120,7 +1184,7 @@ Pattern tab::GUI [New] <js> Channel rename dialog in channel header context menu. - [Imp] <js> Tidied up the upper panel. It fits perfectly on a 1024x768 screen with treeview enabled and also works on 800x600 with treeview disabled. With the new layout, about 8 more pattern rows can be seen in comparison to the old, bloated 1.17.02.* interface. + [Imp] <js> Tidied up the upper panel. It fits perfectly on a 1024x768 screen with tree view enabled and also works on 800x600 with tree view disabled. With the new layout, about 8 more pattern rows can be seen in comparison to the old, bloated 1.17.02.* interface. [Mod] <js> Due to this cleanup, the "split keyboard" feature has been removed from the interface. The split keyboard settings dialog can now be accessed by using a shortcut, which should be even faster than the old method. [Imp] <al> If keyboard split is active, instrument drop list will show split instrument and split note. [Imp] <js> Grey out pattern name input field when in MOD/S3M mode. @@ -1164,8 +1228,8 @@ [Imp] <js> If sample size is < 1 KB, amount of bytes is shown instead of "0 KB". [Fix] <js> The lower part of the tab was receiving update messages that were not even meaningful to this tab (e.g. speed changes), so it was updating quite often modules that have alternating speed and the toolbar was "blinking"... Only letting in important update messages now. -Treeview - [New] <js> Show sequences in song treeview. Sequences can be inserted, duplicated and deleted by right-clicking the sequence items. +Tree view + [New] <js> Show sequences in song tree view. Sequences can be inserted, duplicated and deleted by right-clicking the sequence items. [New] <js> Clicking on a mod item (i.e. a filename node) switches to the corresponding window. [New] <js> Added right-click options for mod items. [New] <js> Display playing samples / instruments (only those that are assigned to a sample) using green triangles. Can be enabled from setup screen. @@ -1212,7 +1276,7 @@ [Fix] <js> Reset NNA actions on every note (tentative fix, fixes spx-farspacedance.it). [Fix] <js> Fixes from SchismTracker: Vol Swing, Pan Swing, Pitch / Pan Separation (PPS). [Fix] <js> Out of range offset command with Old FX on. - [Fix] <js> Impvored S3x / S4x / S5x handling. + [Fix] <js> Improved S3x / S4x / S5x handling. S3M [Fix] <js> ST3 compatibility: Only allow waveforms 0 to 3 for S3x / S4x / S5x. @@ -1376,7 +1440,7 @@ [Imp] <js> Default view mode is instruments instead of samples for XM files. [Imp] <js> Instrument / Sample list: Double click will switch to instrument / sample. -Treeview +Tree view [Fix] <js> Playing sounds from a soundfont was broken. [Fix] <js> Deleting patterns from a module will also reset their names. @@ -1689,7 +1753,7 @@ [Fix] <al> Fix to crash when loading plugins with long (> 32 characters) parameter names. [Fix] <al, ma> Fix to possible memory corruption problem on handling VST plugins with more than 30 outputs. - Plugins with more than 32 outputs might still be handled poorly. - [Fix] <al> Fix to possible crash when browsing modules in treeview (http://forum.openmpt.org/index.php?topic=2222.0). + [Fix] <al> Fix to possible crash when browsing modules in tree view (http://forum.openmpt.org/index.php?topic=2222.0). [Fix] <al> Fix to severe memory leak in the same section as above. [Fix] <al> Fix to mptm not showing in tree view file browser. [Fix] <al> Fix to MIDI drum export (http://forum.openmpt.org/index.php?topic=2024.0). @@ -1907,7 +1971,7 @@ [Fix] <rf> No longer issue MIDI bank & program message every time MIDI channel changes - this fixes HyperCanvas behaviour (tx ganja) [Fix] <rf> Fixed: new channel mute mode did not mute VSTis at all. [Fix] <rf> Fixed: changing mute mode while some channels were muted prevented them from being unmuted. - [Fix] <rf> Fixed: editing a pattern from treeview by double clicking it was broken + [Fix] <rf> Fixed: editing a pattern from tree view by double clicking it was broken [Fix] <rf> Editing of note column of sample map is disabled for XMs (XM doesn't save that data). [Fix] <rf> Fixed: If you agreed to reorganized instrument during an instrument cleanup, nothing at all would happen. [Fix] <rf> Fixed Pattern amplification had no effect on instruments mapped to "phantom samples" (tx lpchip) @@ -2004,7 +2068,7 @@ ----------- [Mod] <rf> Minor cosmetic changes. [Fix] <rf> XMs saved in OpenMPT should no longer have a bunch of blank patterns at the end when played in XMPlay. - [Fix] <rf> Some instrument properties were saved incorrectly if an instrument had been deleted (either from song cleanup or treeview). + [Fix] <rf> Some instrument properties were saved incorrectly if an instrument had been deleted (either from song cleanup or tree view). v1.17.02.26 @@ -2481,7 +2545,7 @@ [Fix] Fixed transpose octave down key (bug introduced 20040910) [Fix] Fixed note fade on key release in instrument view. (tx Ganja) bug introduced 20040910 [Fix] Prevented multiple note playback in sample view, except on chord playback. (tx LPChip) (bug introduced 20040910) - [Fix] Finished custom note handling for instrument notemapper and treeview (tx Ganja) (bug introduced 20040910) + [Fix] Finished custom note handling for instrument notemapper and tree view (tx Ganja) (bug introduced 20040910) [Fix] This version shouldn't corrupt the custom key registry setting used by previous versions of MPT. (bug introduced 20040910) [New] Can now save orders past blank order, a la IT2. (tx Nofold) [New] Some pattern undo improvements (still far from perfect!) Added: trunk/OpenMPT/packageTemplate/OMPT_1.21_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.21_ReleaseNotes.html (rev 0) +++ trunk/OpenMPT/packageTemplate/OMPT_1.21_ReleaseNotes.html 2012-12-22 18:19:58 UTC (rev 1472) @@ -0,0 +1,164 @@ +<?xml version="1.0" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>OpenMPT 1.21 Release Notes</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="language" content="en" /> + <style type="text/css"> + * { font-family: Calibri, sans-serif; } + body + { + color: #222; + background: #eee; + font-size: 13pt; + margin: 0 0 1em 0; + padding: 0; + border: none; + } + + a { color: #b30; text-decoration: none; } + a:visited { color: #910; text-decoration: none; } + a:hover { text-decoration: underline; } + + .screenshots + { + float:right; + text-align:right; + } + + .screenshots img, h1 + { + border: 1px solid #ccc; + padding: 3px; + background: #f0f0f0; + margin: 0 0 3px 3px; + } + + p { margin: 0.5em 1em; padding: 0; } + + h1 + { + margin: 0 0 1em 0; + padding: 10px; + font-size: 24pt; + color: #444; + text-shadow: 1px 1px 1px #999; + background: #ddd; + background-image: linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -o-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -moz-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -webkit-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -ms-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.2, #ddd), color-stop(0.6, #eee)); + border-width: 0 0 1px 0; + } + + h1 img { vertical-align: middle; margin-right: 1em; } + + h2, h3, h4 + { + border: 1px solid #ccc; + border-width: 0 0 0 3em; + margin: 1em 0.5em; + padding: 0px 5px; + font-size: 18pt; + color: #333; + text-shadow: 1px 1px #fff; + } + + h3 { border-left-width: 2em; } + h4 { border-left-width: 1em; } + + li {list-style-type: none; padding: 0 0 0.5em 0; } + li:before { content: "» "; } + + li li { padding: 0; } + + /* use this for pattern data */ + pre + { + font-family: monospace; + display: inline; + color: #006; + } + + tt + { + font-family: monospace; + } + + </style> + </head> + <body> + + <h1> + <img src="ReleaseNotesImages/general/modplug.png" width="81" height="80" alt="OpenMPT Logo" /> + OpenMPT 1.21 - Release Notes + </h1> + + <p> + Not much time has passed since the last official release (version 1.20.04.00), but nevertheless this new major version of OpenMPT has introduced a number of noteworthy new features. + This document should give a rough overview about the greatest changes in OpenMPT 1.21. + </p> + + <h2>What's new?</h2> + + <h3>General</h3> + <div class="screenshots"> + <a href="ReleaseNotesImages/1.21/treeview.png"><img src="ReleaseNotesImages/1.21/treeview.png" width="227" height="253" alt="New treeview options" title="New treeview options (click to view big screenshot)" /></a> + </div> + <ul> + <li>The <strong>treeview</strong> can now be used to rearrange (drag and drop), insert and duplicate (through the context menu) samples and instruments (yes, this was supposed to be possible in OpenMPT 1.20 already, but it was really buggy).</li> + </ul> + + <h3>Pattern Editor</h3> + <ul> + <li>An option to <strong>quantize recorded notes</strong> has been added. Notes that are recorded live through MIDI or the computer keyboard can be quantized, i.e. they are shifted up or down to the closest row that is a multiple of the quantize setting. Even with a quantize value of 1, this provides much more accurate results that not using quantization at all!</li> + <li>New <strong>Data Entry</strong> shortcuts can be used to increase or decrease the value of the currently selected pattern cells (note, instrument, effect parameters), either by +/- 1 or by a coarse value depending on the column.</li> + <li>If no selection has been made, <strong>interpolation shortcuts</strong> now interpolate between the nearest notes / instruments / commands above and below the cursor position.</li> + </ul> + + <h3>Sample Editor</h3> + <ul> + <li>Support for <strong>FLAC samples</strong> (both reading and writing) has been added!</li> + <li>New stereo to <strong>mono sample conversion</strong> modes: Keep only left / right channel, split stereo sample into two mono samples.</li> + <li>It is now possible to <strong>drag and drop multiple samples</strong> from explorer.</li> + </ul> + + <h3>Instrument Editor</h3> + <ul> + <li><strong>Moving the envelope tail</strong> (using Ctrl + Drag) also works properly if the distance between the moved point and the following point is small.</li> + <li>Usability improvements when click-dragging the mouse over the <strong>sample map</strong>.</li> + <li>It is now possible to <strong>drag and drop multiple instruments</strong> from explorer.</li> + </ul> + + <h3>There's more...</h3> + <p> + For a detailed description of what has changed, check <a href="History.txt">History.txt</a>. If you are new to OpenMPT, be sure to read the manual as well. + </p> + + <h2>Known Issues</h2> + <p> + <i>This list has mostly been copied over from the old OpenMPT 1.17 RC2 release notes, so this not very comprehensive... :-)</i> + </p> + <ul> + <li>Far from perfect VST support (no buses for audio / MIDI routing, only a few tracker effects are supported, etc...)</li> + <li>Previewing samples from the treeview's file browser stops the playing module.</li> + <li>Cannot preview instruments directly from the MIDI Library in the tree view.</li> + <li>Excessive performance drop when dragging over the graphical parameter editor during playback.</li> + <li>The Right Alt (or Alt Gr) key is not handled well by the keyboard configuration.</li> + <li>In Windows 98, the graphical parameter editor and instrument envelope editor grid display are messed up.</li> + <li>There is no really <em>convenient</em> way to find out what features of the tracker are supported by the original trackers (Impulse Tracker, Fasttracker 2, etc...) when working with those file formats...</li> + </ul> + + <h2>Contact</h2> + <p> + Helpful bug reports, new ideas and brave volunteers to test early development builds or contribute to the code are more than welcome!<br /> + Our issue tracker is located at <a href="http://bugs.openmpt.org/">http://bugs.openmpt.org/</a> and can be used to report bugs and feature requests.<br /> + You can also meet us at the ModPlug Central forums: <a href="http://forum.openmpt.org/">http://forum.openmpt.org/</a>. + </p> + + </body> +</html> \ No newline at end of file Index: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21 =================================================================== --- trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21 2012-12-22 15:48:48 UTC (rev 1471) +++ trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21 2012-12-22 18:19:58 UTC (rev 1472) Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21 ___________________________________________________________________ Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21/treeview.png =================================================================== (Binary files differ) Index: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21/treeview.png =================================================================== --- trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21/treeview.png 2012-12-22 15:48:48 UTC (rev 1471) +++ trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21/treeview.png 2012-12-22 18:19:58 UTC (rev 1472) Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.21/treeview.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Modified: trunk/OpenMPT/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/packageTemplate/readme.txt 2012-12-22 15:48:48 UTC (rev 1471) +++ trunk/OpenMPT/packageTemplate/readme.txt 2012-12-22 18:19:58 UTC (rev 1472) @@ -1,5 +1,5 @@ ****************** -* OpenMPT 1.20 * +* OpenMPT 1.21 * ****************** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-22 21:07:32
|
Revision: 1474 http://sourceforge.net/p/modplug/code/1474 Author: saga-games Date: 2012-12-22 21:07:21 +0000 (Sat, 22 Dec 2012) Log Message: ----------- [Mod] Changed VS2008 project settings (LIBCMTD warning, ReleaseWithoutAsm project configuration) Modified Paths: -------------- trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj trunk/OpenMPT/mptrack/MPTRACK_08.sln Removed Paths: ------------- trunk/OpenMPT/mptrack/commandList.h Modified: trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj =================================================================== --- trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj 2012-12-22 18:24:07 UTC (rev 1473) +++ trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj 2012-12-22 21:07:21 UTC (rev 1474) @@ -25,7 +25,7 @@ OutputDirectory="x86\ZlibStat$(ConfigurationName)" IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" - InheritedPropertySheets="UpgradeFromVC70.vsprops" + InheritedPropertySheets="C:\Programme\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > @@ -50,7 +50,7 @@ AdditionalIncludeDirectories="..\..\..;..\..\masmx86" PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS" ExceptionHandling="0" - RuntimeLibrary="1" + RuntimeLibrary="3" BufferSecurityCheck="false" PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" AssemblerListingLocation="$(IntDir)\" @@ -94,11 +94,11 @@ /> </Configuration> <Configuration - Name="Debug|x64" - OutputDirectory="x64\ZlibStat$(ConfigurationName)" - IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp" + Name="Release|Win32" + OutputDirectory="x86\ZlibStat$(ConfigurationName)" + IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" - InheritedPropertySheets="UpgradeFromVC70.vsprops" + InheritedPropertySheets="C:\Programme\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > @@ -116,24 +116,23 @@ /> <Tool Name="VCMIDLTool" - TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" - Optimization="0" + InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\..;..\..\masmx86" - PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" + PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF" + StringPooling="true" ExceptionHandling="0" - RuntimeLibrary="3" + RuntimeLibrary="0" BufferSecurityCheck="false" + EnableFunctionLevelLinking="true" PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" AssemblerListingLocation="$(IntDir)\" ObjectFile="$(IntDir)\" ProgramDataBaseFileName="$(OutDir)\" WarningLevel="3" SuppressStartupBanner="true" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="1" /> <Tool Name="VCManagedResourceCompilerTool" @@ -147,7 +146,8 @@ /> <Tool Name="VCLibrarianTool" - AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB" + AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB" + AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj " OutputFile="$(OutDir)\zlibstat.lib" SuppressStartupBanner="true" /> @@ -168,11 +168,11 @@ /> </Configuration> <Configuration - Name="Debug|Itanium" - OutputDirectory="ia64\ZlibStat$(ConfigurationName)" - IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp" + Name="ReleaseWithoutAsm|Win32" + OutputDirectory="x86\ZlibStat$(ConfigurationName)" + IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" - InheritedPropertySheets="UpgradeFromVC70.vsprops" + InheritedPropertySheets="C:\Programme\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > @@ -190,24 +190,23 @@ /> <Tool Name="VCMIDLTool" - TargetEnvironment="2" /> <Tool Name="VCCLCompilerTool" - Optimization="0" + InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\..;..\..\masmx86" - PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" + PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS" + StringPooling="true" ExceptionHandling="0" - RuntimeLibrary="3" + RuntimeLibrary="0" BufferSecurityCheck="false" + EnableFunctionLevelLinking="true" PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" AssemblerListingLocation="$(IntDir)\" ObjectFile="$(IntDir)\" ProgramDataBaseFileName="$(OutDir)\" WarningLevel="3" SuppressStartupBanner="true" - Detect64BitPortabilityProblems="true" - DebugInformationFormat="1" /> <Tool Name="VCManagedResourceCompilerTool" @@ -221,7 +220,7 @@ /> <Tool Name="VCLibrarianTool" - AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB" + AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB" OutputFile="$(OutDir)\zlibstat.lib" SuppressStartupBanner="true" /> @@ -242,9 +241,9 @@ /> </Configuration> <Configuration - Name="Release|Win32" - OutputDirectory="x86\ZlibStat$(ConfigurationName)" - IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" + Name="Debug|x64" + OutputDirectory="x64\ZlibStat$(ConfigurationName)" + IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" InheritedPropertySheets="UpgradeFromVC70.vsprops" UseOfMFC="0" @@ -264,23 +263,24 @@ /> <Tool Name="VCMIDLTool" + TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" - InlineFunctionExpansion="1" + Optimization="0" AdditionalIncludeDirectories="..\..\..;..\..\masmx86" - PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF" - StringPooling="true" + PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" ExceptionHandling="0" - RuntimeLibrary="0" + RuntimeLibrary="3" BufferSecurityCheck="false" - EnableFunctionLevelLinking="true" PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" AssemblerListingLocation="$(IntDir)\" ObjectFile="$(IntDir)\" ProgramDataBaseFileName="$(OutDir)\" WarningLevel="3" SuppressStartupBanner="true" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="1" /> <Tool Name="VCManagedResourceCompilerTool" @@ -294,8 +294,7 @@ /> <Tool Name="VCLibrarianTool" - AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB" - AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj " + AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB" OutputFile="$(OutDir)\zlibstat.lib" SuppressStartupBanner="true" /> @@ -316,9 +315,9 @@ /> </Configuration> <Configuration - Name="Release|x64" - OutputDirectory="x64\ZlibStat$(ConfigurationName)" - IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp" + Name="Debug|Itanium" + OutputDirectory="ia64\ZlibStat$(ConfigurationName)" + IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" InheritedPropertySheets="UpgradeFromVC70.vsprops" UseOfMFC="0" @@ -338,24 +337,24 @@ /> <Tool Name="VCMIDLTool" - TargetEnvironment="3" + TargetEnvironment="2" /> <Tool Name="VCCLCompilerTool" - InlineFunctionExpansion="1" + Optimization="0" AdditionalIncludeDirectories="..\..\..;..\..\masmx86" - PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64" - StringPooling="true" + PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" ExceptionHandling="0" - RuntimeLibrary="2" + RuntimeLibrary="3" BufferSecurityCheck="false" - EnableFunctionLevelLinking="true" PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" AssemblerListingLocation="$(IntDir)\" ObjectFile="$(IntDir)\" ProgramDataBaseFileName="$(OutDir)\" WarningLevel="3" SuppressStartupBanner="true" + Detect64BitPortabilityProblems="true" + DebugInformationFormat="1" /> <Tool Name="VCManagedResourceCompilerTool" @@ -369,8 +368,7 @@ /> <Tool Name="VCLibrarianTool" - AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB" - AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj " + AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB" OutputFile="$(OutDir)\zlibstat.lib" SuppressStartupBanner="true" /> @@ -391,9 +389,9 @@ /> </Configuration> <Configuration - Name="Release|Itanium" - OutputDirectory="ia64\ZlibStat$(ConfigurationName)" - IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp" + Name="Release|x64" + OutputDirectory="x64\ZlibStat$(ConfigurationName)" + IntermediateDirectory="x64\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" InheritedPropertySheets="UpgradeFromVC70.vsprops" UseOfMFC="0" @@ -413,13 +411,13 @@ /> <Tool Name="VCMIDLTool" - TargetEnvironment="2" + TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\..;..\..\masmx86" - PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" + PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64" StringPooling="true" ExceptionHandling="0" RuntimeLibrary="2" @@ -444,7 +442,8 @@ /> <Tool Name="VCLibrarianTool" - AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB" + AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB" + AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj " OutputFile="$(OutDir)\zlibstat.lib" SuppressStartupBanner="true" /> @@ -465,9 +464,9 @@ /> </Configuration> <Configuration - Name="ReleaseWithoutAsm|Win32" - OutputDirectory="x86\ZlibStat$(ConfigurationName)" - IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" + Name="Release|Itanium" + OutputDirectory="ia64\ZlibStat$(ConfigurationName)" + IntermediateDirectory="ia64\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" InheritedPropertySheets="UpgradeFromVC70.vsprops" UseOfMFC="0" @@ -487,15 +486,16 @@ /> <Tool Name="VCMIDLTool" + TargetEnvironment="2" /> <Tool Name="VCCLCompilerTool" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\..;..\..\masmx86" - PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS" + PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64" StringPooling="true" ExceptionHandling="0" - RuntimeLibrary="0" + RuntimeLibrary="2" BufferSecurityCheck="false" EnableFunctionLevelLinking="true" PrecompiledHeaderFile="$(IntDir)/zlibstat.pch" @@ -517,7 +517,7 @@ /> <Tool Name="VCLibrarianTool" - AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB" + AdditionalOptions="/MACHINE:IA64 /NODEFAULTLIB" OutputFile="$(OutDir)\zlibstat.lib" SuppressStartupBanner="true" /> @@ -744,7 +744,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug|Itanium" + Name="Release|Win32" ExcludedFromBuild="true" > <Tool @@ -752,7 +752,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Win32" + Name="ReleaseWithoutAsm|Win32" ExcludedFromBuild="true" > <Tool @@ -760,7 +760,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release|Itanium" + Name="Debug|Itanium" ExcludedFromBuild="true" > <Tool @@ -768,7 +768,7 @@ /> </FileConfiguration> <FileConfiguration - Name="ReleaseWithoutAsm|Win32" + Name="Release|Itanium" ExcludedFromBuild="true" > <Tool Modified: trunk/OpenMPT/mptrack/MPTRACK_08.sln =================================================================== --- trunk/OpenMPT/mptrack/MPTRACK_08.sln 2012-12-22 18:24:07 UTC (rev 1473) +++ trunk/OpenMPT/mptrack/MPTRACK_08.sln 2012-12-22 21:07:21 UTC (rev 1474) @@ -37,63 +37,44 @@ GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 - ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {21D95071-FB97-4E69-B3B1-050D0D4A5021}.Debug|Win32.ActiveCfg = Debug|Win32 {21D95071-FB97-4E69-B3B1-050D0D4A5021}.Debug|Win32.Build.0 = Debug|Win32 {21D95071-FB97-4E69-B3B1-050D0D4A5021}.Release|Win32.ActiveCfg = Release|Win32 {21D95071-FB97-4E69-B3B1-050D0D4A5021}.Release|Win32.Build.0 = Release|Win32 - {21D95071-FB97-4E69-B3B1-050D0D4A5021}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 - {21D95071-FB97-4E69-B3B1-050D0D4A5021}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.Debug|Win32.ActiveCfg = Debug|Win32 {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.Debug|Win32.Build.0 = Debug|Win32 {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.Release|Win32.ActiveCfg = Release|Win32 {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.Release|Win32.Build.0 = Release|Win32 - {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 - {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Debug|Win32.ActiveCfg = Debug|Win32 {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Debug|Win32.Build.0 = Debug|Win32 {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Release|Win32.ActiveCfg = Release|Win32 {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Release|Win32.Build.0 = Release|Win32 - {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 - {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 {44316F22-904E-48AA-B841-5A3A6AC77319}.Debug|Win32.ActiveCfg = Debug|Win32 {44316F22-904E-48AA-B841-5A3A6AC77319}.Debug|Win32.Build.0 = Debug|Win32 {44316F22-904E-48AA-B841-5A3A6AC77319}.Release|Win32.ActiveCfg = Release|Win32 {44316F22-904E-48AA-B841-5A3A6AC77319}.Release|Win32.Build.0 = Release|Win32 - {44316F22-904E-48AA-B841-5A3A6AC77319}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 - {44316F22-904E-48AA-B841-5A3A6AC77319}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Debug|Win32.ActiveCfg = Debug|Win32 {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Debug|Win32.Build.0 = Debug|Win32 {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Release|Win32.ActiveCfg = Release|Win32 {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Release|Win32.Build.0 = Release|Win32 - {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 - {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Debug|Win32.ActiveCfg = Debug|Win32 {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Debug|Win32.Build.0 = Debug|Win32 {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Release|Win32.ActiveCfg = Release|Win32 {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Release|Win32.Build.0 = Release|Win32 - {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 - {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32 {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32 {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32 {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32 - {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 - {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|Win32.ActiveCfg = Debug|Win32 {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|Win32.Build.0 = Debug|Win32 {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|Win32.ActiveCfg = Release|Win32 {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|Win32.Build.0 = Release|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 - {94CD7910-649A-4075-9F33-7EBEE614FD45}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 {4CEFBC84-C215-11DB-8314-0800200C9A66}.Debug|Win32.ActiveCfg = Debug|Win32 {4CEFBC84-C215-11DB-8314-0800200C9A66}.Debug|Win32.Build.0 = Debug|Win32 {4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|Win32.ActiveCfg = Release|Win32 {4CEFBC84-C215-11DB-8314-0800200C9A66}.Release|Win32.Build.0 = Release|Win32 - {4CEFBC84-C215-11DB-8314-0800200C9A66}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 - {4CEFBC84-C215-11DB-8314-0800200C9A66}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Deleted: trunk/OpenMPT/mptrack/commandList.h =================================================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-23 19:32:17
|
Revision: 1476 http://sourceforge.net/p/modplug/code/1476 Author: saga-games Date: 2012-12-23 19:32:07 +0000 (Sun, 23 Dec 2012) Log Message: ----------- [Imp] ITI files can now also be read as samples (only reads first sample, naturally) [Fix] IT Compatibility: pxx should also reset the surround flag, like all other panning commands. [Mod] OpenMPT: Version is now 1.21.01.01 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2012-12-23 19:30:34 UTC (rev 1475) +++ trunk/OpenMPT/mptrack/version.h 2012-12-23 19:32:07 UTC (rev 1476) @@ -17,9 +17,9 @@ //Version definitions. The only thing that needs to be changed when changing version number. #define VER_MAJORMAJOR 1 -#define VER_MAJOR 20 -#define VER_MINOR 04 -#define VER_MINORMINOR 09 +#define VER_MAJOR 21 +#define VER_MINOR 01 +#define VER_MINORMINOR 01 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2012-12-23 19:30:34 UTC (rev 1475) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2012-12-23 19:32:07 UTC (rev 1476) @@ -31,6 +31,7 @@ if(!nSample || nSample >= MAX_SAMPLES) return false; if(!ReadWAVSample(nSample, file) && !ReadXISample(nSample, file) + && !ReadITISample(nSample, file) && !ReadAIFFSample(nSample, file) && !ReadITSSample(nSample, file) && !ReadPATSample(nSample, lpMemFile, dwFileLength) @@ -1492,6 +1493,27 @@ } +bool CSoundFile::ReadITISample(SAMPLEINDEX nSample, FileReader &file) +//------------------------------------------------------------------- +{ + ITInstrument instrumentHeader; + + file.Rewind(); + if(!file.ReadConvertEndianness(instrumentHeader) + || instrumentHeader.id != ITInstrument::magic + || instrumentHeader.nos == 0) + { + return false; + } + file.Rewind(); + ModInstrument dummy; + ITInstrToMPT(file, dummy, instrumentHeader.trkvers); + ReadITSSample(nSample, file, false); + + return true; +} + + bool CSoundFile::ReadITIInstrument(INSTRUMENTINDEX nInstr, FileReader &file) //-------------------------------------------------------------------------- { Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-12-23 19:30:34 UTC (rev 1475) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-12-23 19:32:07 UTC (rev 1476) @@ -1934,8 +1934,13 @@ } else if (volcmd == VOLCMD_PANNING) { - if (vol > 64) vol = 64; - pChn->nPan = vol << 2; + // IT Compatibility (and other trackers as well): panning disables surround (unless panning in rear channels is enabled, which is not supported by the original trackers anyway) + if(IsCompatibleMode(TRK_ALLTRACKERS) && !m_SongFlags[SONG_SURROUNDPAN]) + { + pChn->dwFlags.reset(CHN_SURROUND); + } + if(vol > 64) vol = 64; + pChn->nPan = vol * 4; pChn->dwFlags.set(CHN_FASTVOLRAMP); pChn->nRestorePanOnNewNote = 0; //IT compatibility 20. Set pan overrides random pan Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2012-12-23 19:30:34 UTC (rev 1475) +++ trunk/OpenMPT/soundlib/Sndfile.h 2012-12-23 19:32:07 UTC (rev 1476) @@ -633,6 +633,7 @@ bool ReadAIFFSample(SAMPLEINDEX nSample, FileReader &file); bool ReadXISample(SAMPLEINDEX nSample, FileReader &file); bool ReadITSSample(SAMPLEINDEX nSample, FileReader &file, bool rewind = true); + bool ReadITISample(SAMPLEINDEX nSample, FileReader &file); bool Read8SVXSample(SAMPLEINDEX nInstr, const LPBYTE lpMemFile, DWORD dwFileLength); bool ReadFLACSample(SAMPLEINDEX sample, FileReader &file); bool SaveWAVSample(SAMPLEINDEX nSample, const LPCSTR lpszFileName) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-23 20:08:54
|
Revision: 1477 http://sourceforge.net/p/modplug/code/1477 Author: saga-games Date: 2012-12-23 20:08:46 +0000 (Sun, 23 Dec 2012) Log Message: ----------- [Imp] Find instrument does also search previous patterns now. [Mod] Updated DE_jojo.mkb Modified Paths: -------------- trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2012-12-23 19:32:07 UTC (rev 1476) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2012-12-23 20:08:46 UTC (rev 1477) @@ -6619,20 +6619,40 @@ //--------------------------------- { CSoundFile *sndFile = GetSoundFile(); - if(sndFile == nullptr || !sndFile->Patterns.IsValidPat(m_nPattern)) + if(sndFile == nullptr) { return; } + ORDERINDEX ord = SendCtrlMessage(CTRLMSG_GETCURRENTORDER); + PATTERNINDEX pat = m_nPattern; ROWINDEX row = m_Cursor.GetRow(); - do + + while(sndFile->Patterns.IsValidPat(pat) && sndFile->Patterns[pat].GetNumRows() != 0) { - ModCommand &m = *sndFile->Patterns[m_nPattern].GetpModCommand(row, m_Cursor.GetChannel()); - if(!m.IsPcNote() && m.instr != 0) + // Seek upwards + do { - SendCtrlMessage(CTRLMSG_SETCURRENTINSTRUMENT, m.instr); + ModCommand &m = *sndFile->Patterns[pat].GetpModCommand(row, m_Cursor.GetChannel()); + if(!m.IsPcNote() && m.instr != 0) + { + SendCtrlMessage(CTRLMSG_SETCURRENTINSTRUMENT, m.instr); + break; + } + } while(row-- != 0); + + // Try previous pattern + if(ord == 0) + { break; } - } while(row-- != 0); + ord = sndFile->Order.GetPreviousOrderIgnoringSkips(ord); + pat = sndFile->Order[ord]; + if(!sndFile->Patterns.IsValidPat(pat)) + { + break; + } + row = sndFile->Patterns[pat].GetNumRows() - 1; + } } Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2012-12-23 19:32:07 UTC (rev 1476) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2012-12-23 20:08:46 UTC (rev 1477) @@ -84,6 +84,7 @@ 2:1663:2:3:1 //Toggle follow song: Ctrl+ROLLEN-FESTSTELL (KeyDown) 2:1003:0:13:1 //Quick Copy: EINGABE (KeyDown) 2:1004:0:32:5 //Quick Paste: LEER (KeyDown|KeyHold) +2:1897:1:32:1 //Pick up nearest instrument number: Shift+LEER (KeyDown) 2:1001:2:32:1 //Enable Recording: Ctrl+LEER (KeyDown) 2:1002:2:13:5 //Play Row: Ctrl+EINGABE (KeyDown|KeyHold) 2:1317:4:18:1 //Set row spacing on note entry: Alt (KeyDown) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-26 00:27:33
|
Revision: 1478 http://sourceforge.net/p/modplug/code/1478 Author: saga-games Date: 2012-12-26 00:27:25 +0000 (Wed, 26 Dec 2012) Log Message: ----------- [Imp] Instrument editor: Next/Prev instrument shortcuts and the tab key also work on the sample map now. [Fix] After performing a module cleanup with sample rearranging, some bogus sample slot became visible again when adding a sample afterwards. [Fix] Fixed problem with Play/Pause command when loop song is off (http://bugs.openmpt.org/view.php?id=325) Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2012-12-23 20:08:46 UTC (rev 1477) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2012-12-26 00:27:25 UTC (rev 1478) @@ -521,7 +521,7 @@ if (m_pParent) m_pParent->PostMessage(WM_COMMAND, ID_INSTRUMENT_DUPLICATE); } -//rewbs.customKeys + LRESULT CNoteMapWnd::OnCustomKeyMsg(WPARAM wParam, LPARAM lParam) //--------------------------------------------------------------- { @@ -573,6 +573,8 @@ // Parent shortcuts (also displayed in context menu of this control) case kcInstrumentCtrlDuplicate: OnInstrumentDuplicate(); return wParam; + case kcNextInstrument: if(m_pParent) m_pParent->PostMessage(WM_COMMAND, ID_NEXTINSTRUMENT); return wParam; + case kcPrevInstrument: if(m_pParent) m_pParent->PostMessage(WM_COMMAND, ID_PREVINSTRUMENT); return wParam; } return NULL; @@ -713,8 +715,8 @@ if (m_nNote+3 < NOTE_MAX) { m_nNote += 3; bRedraw = true; } else if (m_nNote < NOTE_MAX - 1) { m_nNote = NOTE_MAX - 1; bRedraw = true; } break; - case VK_TAB: - return true; +// case VK_TAB: +// return true; case VK_RETURN: if (m_pModDoc && m_pModDoc->GetSoundFile()) { Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2012-12-23 20:08:46 UTC (rev 1477) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2012-12-26 00:27:25 UTC (rev 1478) @@ -101,7 +101,7 @@ } if(nRemainingChannels == GetNumChannels() || nRemainingChannels < m_SndFile.GetModSpecifications().channelsMin) { - CString str; + CString str; if(nRemainingChannels == GetNumChannels()) str = "No channels chosen to be removed."; else @@ -218,8 +218,7 @@ if(recordStates[newOrder[nChn]] == 1) Record1Channel(nChn, true); if(recordStates[newOrder[nChn]] == 2) Record2Channel(nChn, true); m_SndFile.m_bChannelMuteTogglePending[nChn] = chnMutePendings[newOrder[nChn]]; - } - else + } else { m_SndFile.InitChannel(nChn); } @@ -309,12 +308,6 @@ sampleNames[i] = m_SndFile.m_szNames[i]; } - // Remove sample data references from now unused slots. - for(SAMPLEINDEX i = newNumSamples + 1; i <= oldNumSamples; i++) - { - m_SndFile.GetSample(i).pSample = nullptr; - } - // Now, create new sample list. m_SndFile.m_nSamples = newNumSamples; for(SAMPLEINDEX i = 0; i < newNumSamples; i++) @@ -341,6 +334,12 @@ } } + // Remove sample data references from now unused slots. + for(SAMPLEINDEX i = newNumSamples + 1; i <= oldNumSamples; i++) + { + m_SndFile.DestroySample(i); + } + if(m_SndFile.GetNumInstruments()) { // Instrument mode: Update sample maps. @@ -391,12 +390,12 @@ CriticalSection cs; - const INSTRUMENTINDEX oldNumInstruments = m_SndFile.GetNumInstruments(); + const INSTRUMENTINDEX oldNumInstruments = m_SndFile.GetNumInstruments(), newNumInstruments = static_cast<INSTRUMENTINDEX>(newOrder.size()); m_SndFile.m_nInstruments = static_cast<INSTRUMENTINDEX>(newOrder.size()); vector<ModInstrument> instrumentHeaders(oldNumInstruments + 1); vector<INSTRUMENTINDEX> newIndex(oldNumInstruments + 1, 0); // One of the new indexes for the old instrument - for(size_t i = 0; i < newOrder.size(); i++) + for(size_t i = 0; i < newNumInstruments; i++) { const INSTRUMENTINDEX origSlot = newOrder[i]; if(origSlot > 0 && origSlot <= oldNumInstruments) @@ -417,7 +416,7 @@ } // Now, create new instrument list. - for(INSTRUMENTINDEX i = 0; i < newOrder.size(); i++) + for(INSTRUMENTINDEX i = 0; i < newNumInstruments; i++) { ModInstrument *ins = m_SndFile.AllocateInstrument(i + 1); if(ins == nullptr) @@ -434,7 +433,7 @@ } // Free unused instruments - for(INSTRUMENTINDEX i = newOrder.size() + 1; i <= oldNumInstruments; i++) + for(INSTRUMENTINDEX i = newNumInstruments + 1; i <= oldNumInstruments; i++) { m_SndFile.DestroyInstrument(i, doNoDeleteAssociatedSamples); } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2012-12-23 20:08:46 UTC (rev 1477) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2012-12-26 00:27:25 UTC (rev 1478) @@ -1025,6 +1025,7 @@ m_nGlobalVolume = m_nDefaultGlobalVolume; m_nMusicSpeed = m_nDefaultSpeed; m_nMusicTempo = m_nDefaultTempo; + visitedSongRows.Initialize(true); } m_SongFlags.reset(SONG_CPUVERYHIGH | SONG_FADINGSONG | SONG_ENDREACHED | SONG_GLOBALFADE); for (nPattern = 0; nPattern < Order.size(); nPattern++) @@ -1881,7 +1882,8 @@ for(SAMPLEINDEX i = start; i <= GetModSpecifications().samplesMax; i++) { // When loading into an instrument, ignore non-empty sample names. Else, only use this slot if the sample name is empty or we're in second pass. - if(Samples[i].pSample == nullptr && (!m_szNames[i][0] || passes == 1 || targetInstrument != INSTRUMENTINDEX_INVALID)) + if(i > GetNumSamples() + || (Samples[i].pSample == nullptr && (!m_szNames[i][0] || passes == 1 || targetInstrument != INSTRUMENTINDEX_INVALID))) { // Empty slot, so it's a good candidate already. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-12-26 00:28:48
|
Revision: 1479 http://sourceforge.net/p/modplug/code/1479 Author: saga-games Date: 2012-12-26 00:28:39 +0000 (Wed, 26 Dec 2012) Log Message: ----------- [Fix] Fixed crash in reverb that could occour at high sample rates (also unified reverb handling above 50KHz with normal reverb processing) (http://bugs.openmpt.org/view.php?id=329) [Mod] OpenMPT: Version is now 1.21.01.02 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_rvb.cpp Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2012-12-26 00:27:25 UTC (rev 1478) +++ trunk/OpenMPT/mptrack/version.h 2012-12-26 00:28:39 UTC (rev 1479) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 21 #define VER_MINOR 01 -#define VER_MINORMINOR 01 +#define VER_MINORMINOR 02 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Snd_rvb.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_rvb.cpp 2012-12-26 00:27:25 UTC (rev 1478) +++ trunk/OpenMPT/soundlib/Snd_rvb.cpp 2012-12-26 00:28:39 UTC (rev 1479) @@ -35,7 +35,6 @@ LONG gnRvbLOfsVol = 0; // Internal reverb state -static BOOL g_bRvbDownsample2x = 0; static BOOL g_bLastInPresent = 0; static BOOL g_bLastOutPresent = 0; static int g_nLastRvbIn_xl = 0; @@ -250,19 +249,9 @@ if ((pRvbPreset != spCurrentPreset) || (bReset)) { // Reverb output frequency is half of the dry output rate - FLOAT flOutputFrequency; + FLOAT flOutputFrequency = (FLOAT)CSoundFile::gdwMixingFreq; ENVIRONMENTREVERB rvb; - if (CSoundFile::gdwMixingFreq > 50000) - { - flOutputFrequency = (FLOAT)(CSoundFile::gdwMixingFreq>>1); - g_bRvbDownsample2x = TRUE; - } else - { - flOutputFrequency = (FLOAT)CSoundFile::gdwMixingFreq; - g_bRvbDownsample2x = FALSE; - } - // Reset reverb parameters spCurrentPreset = pRvbPreset; I3dl2_to_Generic(pRvbPreset, &rvb, flOutputFrequency, @@ -274,7 +263,7 @@ + RVBDLY2L_LEN + RVBDLY2R_LEN) / 2); // Store reverb decay time (in samples) for reverb auto-shutdown - gnReverbDecaySamples = (g_bRvbDownsample2x) ? rvb.ReverbDecaySamples * 2 : rvb.ReverbDecaySamples; + gnReverbDecaySamples = rvb.ReverbDecaySamples; // Room attenuation at high frequencies LONG nRoomLP; @@ -392,17 +381,8 @@ lDryVol = 16 - (((16-lDryVol) * lMaxRvbGain) >> 15); X86_ReverbDryMix(MixSoundBuffer, MixReverbBuffer, lDryVol, nSamples); // Downsample 2x + 1st stage of lowpass filter - if (g_bRvbDownsample2x) - { - nIn = X86_ReverbProcessPreFiltering2x(MixReverbBuffer, nSamples); - nOut = nSamples; - if (g_bLastOutPresent) nOut--; - nOut = (nOut+1)>>1; - } else - { - nIn = X86_ReverbProcessPreFiltering1x(MixReverbBuffer, nSamples); - nOut = nIn; - } + nIn = X86_ReverbProcessPreFiltering1x(MixReverbBuffer, nSamples); + nOut = nIn; // Main reverb processing: split into small chunks (needed for short reverb delays) // Reverb Input + Low-Pass stage #2 + Pre-diffusion if (nIn > 0) MMX_ProcessPreDelay(&g_RefDelay, MixReverbBuffer, nIn); @@ -433,14 +413,7 @@ // Adjust nDelayPos, in case nIn != nOut g_RefDelay.nDelayPos = (g_RefDelay.nDelayPos - nOut + nIn) & SNDMIX_REFLECTIONS_DELAY_MASK; // Upsample 2x - if (g_bRvbDownsample2x) - { - MMX_ReverbDCRemoval(MixReverbBuffer, nOut); - X86_ReverbProcessPostFiltering2x(MixReverbBuffer, MixSoundBuffer, nSamples); - } else - { - MMX_ReverbProcessPostFiltering1x(MixReverbBuffer, MixSoundBuffer, nSamples); - } + MMX_ReverbProcessPostFiltering1x(MixReverbBuffer, MixSoundBuffer, nSamples); // Automatically shut down if needed if (gnReverbSend) gnReverbSamples = gnReverbDecaySamples; else if (gnReverbSamples > nSamples) gnReverbSamples -= nSamples; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-01-01 21:03:38
|
Revision: 1481 http://sourceforge.net/p/modplug/code/1481 Author: saga-games Date: 2013-01-01 21:03:28 +0000 (Tue, 01 Jan 2013) Log Message: ----------- [Fix] IT Compatibility: Envelope reset should now work correctly (http://bugs.openmpt.org/view.php?id=330) (copied from Schism Tracker) [Var] Fixed VS2008 zlib project. [Mod] OpenMPT: Version is now 1.21.01.03 Modified Paths: -------------- trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp Removed Paths: ------------- trunk/OpenMPT/include/zlib/contrib/vstudio/vc7/ trunk/OpenMPT/include/zlib/contrib/vstudio/vc8/ Modified: trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj =================================================================== --- trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj 2012-12-27 10:12:32 UTC (rev 1480) +++ trunk/OpenMPT/include/zlib/contrib/vstudio/vc9/zlibstat.vcproj 2013-01-01 21:03:28 UTC (rev 1481) @@ -25,7 +25,7 @@ OutputDirectory="x86\ZlibStat$(ConfigurationName)" IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" - InheritedPropertySheets="C:\Programme\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops" + InheritedPropertySheets="UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > @@ -98,7 +98,7 @@ OutputDirectory="x86\ZlibStat$(ConfigurationName)" IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" - InheritedPropertySheets="C:\Programme\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops" + InheritedPropertySheets="UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > @@ -172,7 +172,7 @@ OutputDirectory="x86\ZlibStat$(ConfigurationName)" IntermediateDirectory="x86\ZlibStat$(ConfigurationName)\Tmp" ConfigurationType="4" - InheritedPropertySheets="C:\Programme\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\UpgradeFromVC70.vsprops" + InheritedPropertySheets="UpgradeFromVC70.vsprops" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="false" > Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2012-12-27 10:12:32 UTC (rev 1480) +++ trunk/OpenMPT/mptrack/version.h 2013-01-01 21:03:28 UTC (rev 1481) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 21 #define VER_MINOR 01 -#define VER_MINORMINOR 02 +#define VER_MINORMINOR 03 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-12-27 10:12:32 UTC (rev 1480) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-01-01 21:03:28 UTC (rev 1481) @@ -641,10 +641,10 @@ if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL) { ASSERT(false); - return; - } + return; + } UINT n = pIns->Keyboard[note-1]; - pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : nullptr; + pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : nullptr; if(pSmp != pChn->pModSample) { ASSERT(false); @@ -774,23 +774,48 @@ // Reset envelopes - if (bResetEnv) + if(bResetEnv) { - if(!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || m_SongFlags[SONG_ITCOMPATGXX] - || !pChn->nLength || (pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol) - // IT compatibility tentative fix: Reset envelopes when instrument changes. - || (IsCompatibleMode(TRK_IMPULSETRACKER) && instrumentChanged)) + // Blurb by Storlek (from the SchismTracker code): + // Conditions experimentally determined to cause envelope reset in Impulse Tracker: + // - no note currently playing (of course) + // - note given, no portamento + // - instrument number given, portamento, compat gxx enabled + // - instrument number given, no portamento, after keyoff, old effects enabled + // If someone can enlighten me to what the logic really is here, I'd appreciate it. + // Seems like it's just a total mess though, probably to get XMs to play right. + + bool reset, resetAlways; + + // IT Compatibility: Envelope reset + // Test case: EnvReset.it + if(IsCompatibleMode(TRK_IMPULSETRACKER)) { + reset = (!pChn->nLength + || (instrumentChanged && bPorta && m_SongFlags[SONG_ITCOMPATGXX]) + || (instrumentChanged && !bPorta && pChn->dwFlags[CHN_NOTEFADE | CHN_KEYOFF] && m_SongFlags[SONG_ITOLDEFFECTS])); + resetAlways = (instrumentChanged || pChn->dwFlags[CHN_KEYOFF]); + } else + { + reset = (!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || m_SongFlags[SONG_ITCOMPATGXX] + || !pChn->nLength || (pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol)); + resetAlways = !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || instrumentChanged || pIns == nullptr || pChn->dwFlags[CHN_KEYOFF | CHN_NOTEFADE]; + } + + if(reset) + { pChn->dwFlags.set(CHN_FASTVOLRAMP); - - if((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (!instrumentChanged) && (pIns) && !pChn->dwFlags[CHN_KEYOFF | CHN_NOTEFADE]) + if(pIns != nullptr) { - if(!pIns->VolEnv.dwFlags[ENV_CARRY]) pChn->VolEnv.Reset(); - if(!pIns->PanEnv.dwFlags[ENV_CARRY]) pChn->PanEnv.Reset(); - if(!pIns->PitchEnv.dwFlags[ENV_CARRY]) pChn->PitchEnv.Reset(); - } else - { - pChn->ResetEnvelopes(); + if(resetAlways) + { + pChn->ResetEnvelopes(); + } else + { + if(!pIns->VolEnv.dwFlags[ENV_CARRY]) pChn->VolEnv.Reset(); + if(!pIns->PanEnv.dwFlags[ENV_CARRY]) pChn->PanEnv.Reset(); + if(!pIns->PitchEnv.dwFlags[ENV_CARRY]) pChn->PitchEnv.Reset(); + } } // IT Compatibility: Autovibrato reset @@ -1325,7 +1350,7 @@ n = pIns->Keyboard[note - 1]; note = pIns->NoteMap[note - 1]; if(n > 0 && n < MAX_SAMPLES) pSample = Samples[n].pSample; - } + } } else pSample = nullptr; } ModChannel *p = pChn; @@ -1864,7 +1889,7 @@ // Note Cut/Off/Fade => ignore instrument if (note >= NOTE_MIN_SPECIAL) instr = 0; - if (ModCommand::IsNote(note)) + if(ModCommand::IsNote(note)) { pChn->nNewNote = pChn->nLastNote = note; @@ -1896,18 +1921,18 @@ } // Instrument Change ? - if (instr) + if(instr) { ModSample *psmp = pChn->pModSample; InstrumentChange(pChn, instr, bPorta, true); pChn->nNewIns = 0; - // Special IT case: portamento+note causes sample change -> ignore portamento - if ((GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) + // Special IT case: portamento+note causes sample change -> ignore portamento + if ((GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)) && (psmp != pChn->pModSample) && (note) && (note < 0x80)) - { - bPorta = false; + { + bPorta = false; + } } - } // New Note ? if (note) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-01-07 14:56:37
|
Revision: 1483 http://sourceforge.net/p/modplug/code/1483 Author: saga-games Date: 2013-01-07 14:56:30 +0000 (Mon, 07 Jan 2013) Log Message: ----------- [Fix] DLS: Tenative fix for some DLS sounds not loading correctly (http://bugs.openmpt.org/view.php?id=331) [Mod] 2013 [Mod] OpenMPT: Version is now 1.21.01.04 Modified Paths: -------------- trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/res/MPTRACK.RC2 trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Dlsbank.cpp trunk/OpenMPT/soundlib/LOAD_DMF.CPP trunk/OpenMPT/soundlib/Load_stm.cpp Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2013-01-04 13:35:16 UTC (rev 1482) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2013-01-07 14:56:30 UTC (rev 1483) @@ -1592,11 +1592,11 @@ static const char* const pArrCredit = { "OpenMPT / ModPlug Tracker|" - "Copyright \xA9 2004-2012 Contributors|" + "Copyright \xA9 2004-2013 Contributors|" "Copyright \xA9 1997-2003 Olivier Lapicque|" "|" "Contributors:|" - "Johannes Schultz (2008-2012)|" + "Johannes Schultz (2008-2013)|" "Ahti Lepp\xE4nen (2005-2011)|" "Robin Fernandes (2004-2007)|" "Sergiy Pylypenko (2007)|" @@ -1639,7 +1639,7 @@ "|||||||" "VST PlugIn Technology by Steinberg Media Technologies GmbH|" "ASIO Technology by Steinberg Media Technologies GmbH|" - "||||||" + "||||||" }; m_static.SubclassDlgItem(IDC_CREDITS,this); Modified: trunk/OpenMPT/mptrack/res/MPTRACK.RC2 =================================================================== --- trunk/OpenMPT/mptrack/res/MPTRACK.RC2 2013-01-04 13:35:16 UTC (rev 1482) +++ trunk/OpenMPT/mptrack/res/MPTRACK.RC2 2013-01-07 14:56:30 UTC (rev 1483) @@ -43,7 +43,7 @@ VALUE "FileDescription", "OpenMPT / ModPlug Tracker" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "ModPlug Tracker" - VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2012 contributors." + VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2013 contributors." VALUE "LegalTrademarks", "M.O.D.P.L.U.G" VALUE "OriginalFilename", "mptrack.exe" VALUE "PrivateBuild", "" Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2013-01-04 13:35:16 UTC (rev 1482) +++ trunk/OpenMPT/mptrack/version.h 2013-01-07 14:56:30 UTC (rev 1483) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 21 #define VER_MINOR 01 -#define VER_MINORMINOR 03 +#define VER_MINORMINOR 04 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Dlsbank.cpp =================================================================== --- trunk/OpenMPT/soundlib/Dlsbank.cpp 2013-01-04 13:35:16 UTC (rev 1482) +++ trunk/OpenMPT/soundlib/Dlsbank.cpp 2013-01-07 14:56:30 UTC (rev 1483) @@ -1740,7 +1740,7 @@ } } // Create a new sample - if (pRgn->nWaveLink == 0) nSmp = 0; else + //if (pRgn->nWaveLink == 0) nSmp = 0; else if (!bDupRgn) { UINT nmaxsmp = (m_nType & MOD_TYPE_XM) ? 16 : 32; Modified: trunk/OpenMPT/soundlib/LOAD_DMF.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2013-01-04 13:35:16 UTC (rev 1482) +++ trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2013-01-07 14:56:30 UTC (rev 1483) @@ -5,7 +5,7 @@ * Notes : If it wasn't already outdated when the tracker was released, this would be a rather interesting * and in some parts even sophisticated format - effect columns are separated by effect type, an easy to * understand BPM tempo mode, effect durations are always divided into a 256th row, vibrato effects are - * specified by period length and the same 8-Bit granularity is used for both volume and panning. + * specified by period length and the same 8-Bit granularity is used for both volume and panning. * Unluckily, this format does not offer any envelopes or multi-sample instruments, and bidi sample loops * are missing as well, so it was already well behind FT2 and IT back then. * Authors: Johannes Schultz (mostly based on DMF.TXT, DMF_EFFC.TXT, trial and error and some invaluable hints by Zatzen) @@ -120,14 +120,14 @@ // Pattern translation memory struct DMF_PATTERNSETTINGS { + vector<ModCommand::NOTE> noteBuffer; // Note buffer + vector<ModCommand::NOTE> lastNote; // Last played note on channel + vector<bool> playDir; // Sample play direction of each channel... false = forward (default) + bool realBPMmode; // true = BPM mode uint8 beat; // Rows per beat uint8 tempoTicks; // Tick mode param uint8 tempoBPM; // BPM mode param - bool realBPMmode; // true = BPM mode uint8 internalTicks; // Ticks per row in final pattern - vector<bool> playDir; // Sample play direction of each channel... false = forward (default) - vector<ModCommand::NOTE> noteBuffer; // Note buffer - vector<ModCommand::NOTE> lastNote; // Last played note on channel }; Modified: trunk/OpenMPT/soundlib/Load_stm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_stm.cpp 2013-01-04 13:35:16 UTC (rev 1482) +++ trunk/OpenMPT/soundlib/Load_stm.cpp 2013-01-07 14:56:30 UTC (rev 1483) @@ -212,12 +212,10 @@ switch(m->command) { case CMD_SPEED: - // I don't know how Axx really works, but I do know that this - // isn't it. It does all sorts of mindbogglingly screwy things: - // 01 - very fast, - // 0F - very slow. - // 10 - fast again! - // I don't get it. + // ST2 assumes that the tempo is 125 * 16 BPM, and effects are updated + // on every 16th tick of a row. This is pretty hard to handle, so we just + // assume the tempo is 125 and divide the speed by 16 instead. + // Parameters below 10 might behave weird. m->param >>= 4; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-01-12 16:32:47
|
Revision: 1484 http://sourceforge.net/p/modplug/code/1484 Author: saga-games Date: 2013-01-12 16:32:37 +0000 (Sat, 12 Jan 2013) Log Message: ----------- [Fix] IT Compatibility: Revised patch from revision 1481 to be actually correct. [Mod] OpenMPT: Version is now 1.21.01.05 Revision Links: -------------- http://sourceforge.net/p/modplug/code/1481 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2013-01-07 14:56:30 UTC (rev 1483) +++ trunk/OpenMPT/mptrack/version.h 2013-01-12 16:32:37 UTC (rev 1484) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 21 #define VER_MINOR 01 -#define VER_MINORMINOR 04 +#define VER_MINORMINOR 05 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-01-07 14:56:30 UTC (rev 1483) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-01-12 16:32:37 UTC (rev 1484) @@ -791,10 +791,11 @@ // Test case: EnvReset.it if(IsCompatibleMode(TRK_IMPULSETRACKER)) { + const bool insNumber = (instr != 0); reset = (!pChn->nLength - || (instrumentChanged && bPorta && m_SongFlags[SONG_ITCOMPATGXX]) - || (instrumentChanged && !bPorta && pChn->dwFlags[CHN_NOTEFADE | CHN_KEYOFF] && m_SongFlags[SONG_ITOLDEFFECTS])); - resetAlways = (instrumentChanged || pChn->dwFlags[CHN_KEYOFF]); + || (insNumber && bPorta && m_SongFlags[SONG_ITCOMPATGXX]) + || (insNumber && !bPorta && pChn->dwFlags[CHN_NOTEFADE | CHN_KEYOFF] && m_SongFlags[SONG_ITOLDEFFECTS])); + resetAlways = (insNumber || pChn->dwFlags[CHN_KEYOFF]); } else { reset = (!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || m_SongFlags[SONG_ITCOMPATGXX] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-01-12 17:50:35
|
Revision: 1486 http://sourceforge.net/p/modplug/code/1486 Author: saga-games Date: 2013-01-12 17:50:23 +0000 (Sat, 12 Jan 2013) Log Message: ----------- [Ref] Changed x % 2 to x % 2u (slightly better assembly output, not that it matters but whatever) Modified Paths: -------------- trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Load_wav.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2013-01-12 17:04:55 UTC (rev 1485) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2013-01-12 17:50:23 UTC (rev 1486) @@ -1170,7 +1170,7 @@ // Success - if((wdh.length % 2) != 0) + if((wdh.length % 2u) != 0) { // Write padding byte if sample size is odd. int8 padding = 0; Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2013-01-12 17:04:55 UTC (rev 1485) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2013-01-12 17:50:23 UTC (rev 1486) @@ -2109,12 +2109,12 @@ if(m_nOutputs > 2) { // first, mix extra outputs on a stereo basis - UINT nOuts = m_nOutputs; + uint32 numOutputs = m_nOutputs; // so if nOuts is not even, let process the last output later - if((nOuts % 2) == 1) nOuts--; + if((numOutputs % 2u) == 1) numOutputs--; // mix extra stereo outputs - for(UINT iOut = 2; iOut < nOuts; iOut++) + for(uint32 iOut = 2; iOut < numOutputs; iOut++) { for(size_t i = 0; i < nSamples; i++) { @@ -2123,12 +2123,12 @@ } // if m_nOutputs is odd, mix half the signal of last output to each channel - if(nOuts != m_nOutputs) + if(numOutputs != m_nOutputs) { // trick : if we are here, nOuts = m_nOutputs - 1 !!! for(size_t i = 0; i < nSamples; i++) { - float v = 0.5f * outputBuffers[nOuts][i]; + float v = 0.5f * outputBuffers[numOutputs][i]; outputBuffers[0][i] += v; outputBuffers[1][i] += v; } Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-01-12 17:04:55 UTC (rev 1485) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-01-12 17:50:23 UTC (rev 1486) @@ -2284,7 +2284,7 @@ CASE('MSF.', m_ModFlags); case 'MIMA': GetMIDIMapper().Deserialize(chunk.GetRawData(), size); break; case 'ChnS': - if(size <= (MAX_BASECHANNELS - 64) * 2 && (size % 2) == 0) + if(size <= (MAX_BASECHANNELS - 64) * 2 && (size % 2u) == 0) { STATIC_ASSERT(CountOf(ChnSettings) >= 64); const uint16 loopLimit = Util::Min(size / 2, CountOf(ChnSettings) - 64); Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2013-01-12 17:04:55 UTC (rev 1485) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2013-01-12 17:50:23 UTC (rev 1486) @@ -279,7 +279,7 @@ { SmpLength writeLength = mptSmp.pSample != nullptr ? mptSmp.nLength : 0; // If the sample size is odd, we have to add a padding byte, as all sample sizes in MODs are even. - if((writeLength % 2) != 0) + if((writeLength % 2u) != 0) { writeLength++; } @@ -505,7 +505,7 @@ } // From mikmod: if the file says FLT8, but the orderlist has odd numbers, it's probably really an FLT4 - if(isFLT8 && (Order[ord] % 2) != 0) + if(isFLT8 && (Order[ord] % 2u) != 0) { m_nChannels = 4; isFLT8 = false; @@ -624,7 +624,7 @@ if(isFLT8) { - if((pat % 2) == 0) + if((pat % 2u) == 0) { // Only create "even" patterns for FLT8 files if(Patterns.Insert(pat / 2, 64)) @@ -648,7 +648,7 @@ for(ROWINDEX row = 0; row < 64; row++) { // FLT8: either write to channel 1 to 4 (even patterns) or 5 to 8 (odd patterns). - ModCommand *rowBase = Patterns[actualPattern].GetpModCommand(row, ((pat % 2) == 0 || !isFLT8) ? 0: 4); + ModCommand *rowBase = Patterns[actualPattern].GetpModCommand(row, ((pat % 2u) == 0 || !isFLT8) ? 0 : 4); for(CHANNELINDEX chn = 0; chn < readChannels; chn++) { @@ -929,7 +929,7 @@ } // Write padding byte if the sample size is odd. - if((sample.nLength % 2) != 0) + if((sample.nLength % 2u) != 0) { fwrite(&silence[0], 1, 1, f); } Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2013-01-12 17:04:55 UTC (rev 1485) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2013-01-12 17:50:23 UTC (rev 1486) @@ -757,7 +757,7 @@ if(writeOrders < 2) { writeOrders = 2; - } else if((writeOrders % 2) != 0) + } else if((writeOrders % 2u) != 0) { // Number of orders should be even writeOrders++; Modified: trunk/OpenMPT/soundlib/Load_wav.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_wav.cpp 2013-01-12 17:04:55 UTC (rev 1485) +++ trunk/OpenMPT/soundlib/Load_wav.cpp 2013-01-12 17:50:23 UTC (rev 1486) @@ -92,7 +92,7 @@ for(CHANNELINDEX channel = 0; channel < wavFile.GetNumChannels(); channel++) { - ChnSettings[channel].nPan = (channel % 2) ? 256 : 0; + ChnSettings[channel].nPan = (channel % 2u) ? 256 : 0; ChnSettings[channel].nVolume = 64; ChnSettings[channel].dwFlags.reset(); } Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-01-12 17:04:55 UTC (rev 1485) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2013-01-12 17:50:23 UTC (rev 1486) @@ -418,12 +418,12 @@ data.length = sample.GetSampleSizeInBytes(); header.filesize += data.length; - if((data.length % 2) != 0) + if((data.length % 2u) != 0) { // Write padding byte if sample size is odd. header.filesize++; } - if((softwareIdLength % 2) != 0) + if((softwareIdLength % 2u) != 0) { header.filesize++; } @@ -467,7 +467,7 @@ (sample.uFlags & CHN_16BIT) ? SampleIO::signedPCM : SampleIO::unsignedPCM) .WriteSample(f, sample); - if((data.length % 2) != 0) + if((data.length % 2u) != 0) { // Write padding byte if sample size is odd. int8 padding = 0; @@ -492,7 +492,7 @@ list.list_len = LittleEndian(softwareIdLength); fwrite(&list, 1, 8, f); fwrite(softwareId, 1, list.list_len, f); - if((softwareIdLength % 2) != 0) + if((softwareIdLength % 2u) != 0) { int8 padding = 0; fwrite(&padding, 1, 1, f); @@ -1410,7 +1410,7 @@ break; } markers.push_back(marker); - markerChunk.Skip(marker.nameLength + ((marker.nameLength % 2) == 0 ? 1 : 0)); + markerChunk.Skip(marker.nameLength + ((marker.nameLength % 2u) == 0 ? 1 : 0)); } if(instrHeader.sustainLoop.playMode != AIFFInstrumentLoop::noLoop) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-01-20 18:40:51
|
Revision: 1504 http://sourceforge.net/p/modplug/code/1504 Author: saga-games Date: 2013-01-20 18:40:43 +0000 (Sun, 20 Jan 2013) Log Message: ----------- [New] Treeview: Most labels can now be edited. Known issue: Typing non-capital letters doesn't seem to work properly, even though the keyboard manager is disabled while editing. [Mod] OpenMPT: Version is now 1.21.01.07 Modified Paths: -------------- trunk/OpenMPT/common/version.h trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/MPTHacks.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/View_tre.h trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/common/version.h =================================================================== --- trunk/OpenMPT/common/version.h 2013-01-19 16:50:01 UTC (rev 1503) +++ trunk/OpenMPT/common/version.h 2013-01-20 18:40:43 UTC (rev 1504) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 21 #define VER_MINOR 01 -#define VER_MINORMINOR 06 +#define VER_MINORMINOR 07 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2013-01-19 16:50:01 UTC (rev 1503) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2013-01-20 18:40:43 UTC (rev 1504) @@ -1707,7 +1707,7 @@ return; } bool bFirst = (pSndFile->GetNumInstruments() == 0); - LONG ins = m_pModDoc->InsertInstrument(); + INSTRUMENTINDEX ins = m_pModDoc->InsertInstrument(); if (ins != INSTRUMENTINDEX_INVALID) { SetCurrentInstrument(ins); Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2013-01-19 16:50:01 UTC (rev 1503) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2013-01-20 18:40:43 UTC (rev 1504) @@ -268,7 +268,7 @@ GetDlgItem(IDC_SPIN_SEQNUM)->EnableWindow(isMultiSeqAvail); // Enable/disable pattern names - BOOL isPatNameAvail = (m_pSndFile->GetType() & (MOD_TYPE_MPT|MOD_TYPE_IT|MOD_TYPE_XM)) ? TRUE : FALSE; + BOOL isPatNameAvail = m_pSndFile->GetModSpecifications().hasPatternNames ? TRUE : FALSE; GetDlgItem(IDC_STATIC_PATTERNNAME)->EnableWindow(isPatNameAvail); GetDlgItem(IDC_EDIT_PATTERNNAME)->EnableWindow(isPatNameAvail); } @@ -842,7 +842,7 @@ ORDERINDEX nInsertWhere = selection.firstOrd + nInsertCount + 1; if (nInsertWhere >= pSndFile->GetModSpecifications().ordersMax) return; - bool bSuccess = false; + bool success = false; // Has this pattern been duplicated already? (for multiselect) vector<PATTERNINDEX> patReplaceIndex(pSndFile->Patterns.Size(), PATTERNINDEX_INVALID); @@ -872,7 +872,7 @@ { memcpy(pSndFile->Patterns[nNewPat], pSndFile->Patterns[nCurPat], n * sizeof(ModCommand)); } - bSuccess = true; + success = true; // Mark as duplicated, so if this pattern is to be duplicated again, the same new pattern number is inserted into the order list. patReplaceIndex[nCurPat] = nNewPat; } else @@ -899,11 +899,11 @@ pSndFile->Order[selection.firstOrd + i + nInsertCount + 1] = nNewPat; } - bSuccess = true; + success = true; } } - if(bSuccess) + if(success) { m_OrderList.InvalidateRect(NULL, FALSE); m_OrderList.SetCurSel(nInsertWhere); Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp =================================================================== --- trunk/OpenMPT/mptrack/MPTHacks.cpp 2013-01-19 16:50:01 UTC (rev 1503) +++ trunk/OpenMPT/mptrack/MPTHacks.cpp 2013-01-20 18:40:43 UTC (rev 1504) @@ -86,7 +86,7 @@ //------------------------------------------------------------------- { bool found = false; - for(UINT i = 1; i < env.nNodes; i++) + for(uint32 i = 1; i < env.nNodes; i++) { if(env.Ticks[i] <= env.Ticks[i - 1]) // "<=" so we can fix envelopes "on the fly" { @@ -287,7 +287,7 @@ } // Check for pattern names - if(m_SndFile.Patterns.GetNumNamedPatterns() > 0) + if(m_SndFile.Patterns.GetNumNamedPatterns() > 0 && !originalSpecs->hasPatternNames) { AddToLog("Found pattern names\n"); foundHacks = true; Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2013-01-19 16:50:01 UTC (rev 1503) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2013-01-20 18:40:43 UTC (rev 1504) @@ -18,11 +18,7 @@ #include "dlg_misc.h" #include "vstplug.h" -#ifndef TVS_SINGLEEXPAND -#define TVS_SINGLEEXPAND 0x400 -#endif - ///////////////////////////////////////////////////////////////////////////// // CModTreeDropTarget @@ -75,6 +71,8 @@ ON_NOTIFY_REFLECT(TVN_ITEMEXPANDED, OnItemExpanded) ON_NOTIFY_REFLECT(TVN_BEGINDRAG, OnBeginLDrag) ON_NOTIFY_REFLECT(TVN_BEGINRDRAG, OnBeginRDrag) + ON_NOTIFY_REFLECT(TVN_BEGINLABELEDIT,OnBeginLabelEdit) + ON_NOTIFY_REFLECT(TVN_ENDLABELEDIT, OnEndLabelEdit) ON_COMMAND(ID_MODTREE_REFRESH, OnRefreshTree) ON_COMMAND(ID_MODTREE_EXECUTE, OnExecuteItem) ON_COMMAND(ID_MODTREE_REMOVE, OnDeleteTreeItem) @@ -88,7 +86,6 @@ ON_COMMAND(ID_MODTREE_INSERT, OnInsertTreeItem) ON_COMMAND(ID_MODTREE_SWITCHTO, OnSwitchToTreeItem) ON_COMMAND(ID_MODTREE_CLOSE, OnCloseItem) - // -> CODE#0023 // -> DESC="IT project files (.itp)" ON_COMMAND(ID_MODTREE_SETPATH, OnSetItemPath) @@ -146,8 +143,8 @@ void CModTree::Init() //------------------- { - DWORD dwRemove = TVS_EDITLABELS|TVS_SINGLEEXPAND; - DWORD dwAdd = TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS | TVS_SHOWSELALWAYS; + DWORD dwRemove = TVS_SINGLEEXPAND; + DWORD dwAdd = TVS_EDITLABELS | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS | TVS_SHOWSELALWAYS; if (!m_pDataTree) { @@ -480,7 +477,7 @@ // Add DLS file folder _splitpath(pDlsBank->GetFileName(), NULL, NULL, szName, szExt); strcat(szName, szExt); - m_tiDLS[iDls] = InsertItem(TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE, + m_tiDLS[iDls] = InsertItem(TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE, szName, IMAGE_FOLDER, IMAGE_FOLDER, 0, 0, 0, TVI_ROOT, hDlsRoot); // Memorize Banks WORD wBanks[16]; @@ -1180,7 +1177,7 @@ if (hItem) { const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); uint32 modItemID = GetModItemID(modItem); ModTreeDocInfo *pInfo = (m_nDocNdx < DocInfo.size() ? DocInfo[m_nDocNdx] : nullptr); CModDoc *pModDoc = (pInfo) ? pInfo->pModDoc : NULL; @@ -1249,7 +1246,7 @@ if (hItem) { const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); uint32 modItemID = GetModItemID(modItem); ModTreeDocInfo *pInfo = (m_nDocNdx < DocInfo.size() ? DocInfo[m_nDocNdx] : nullptr); CModDoc *pModDoc = (pInfo) ? pInfo->pModDoc : NULL; @@ -1414,7 +1411,7 @@ //-------------------------------------------- { const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); const uint32 modItemID = GetModItemID(modItem); TCHAR s[64]; @@ -1508,7 +1505,7 @@ //------------------------------------------ { const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); //const uint32 modItemID = GetModItemID(modItem); switch(modItemType) @@ -2044,10 +2041,10 @@ //--------------------------------------------------- { const uint64 modItemDrop = GetModItem(hItem); - const uint32 modItemDropType = GetModItemType(modItemDrop); + const ModItemType modItemDropType = GetModItemType(modItemDrop); const uint32 modItemDropID = GetModItemID(modItemDrop); - const uint32 modItemDragType = GetModItemType(m_qwItemDrag); + const ModItemType modItemDragType = GetModItemType(m_qwItemDrag); const uint32 modItemDragID = GetModItemID(m_qwItemDrag); const ModTreeDocInfo *pInfoDrag = (m_nDragDocNdx < DocInfo.size() ? DocInfo[m_nDragDocNdx] : nullptr); @@ -2196,9 +2193,9 @@ CHAR szFullPath[_MAX_PATH] = ""; InsLibGetFullPath(m_hItemDrag, szFullPath); if (modItemDropType == MODITEM_MIDIINSTRUMENT) - SetMidiInstrument((DWORD)modItemDropID, szFullPath); + SetMidiInstrument(modItemDropID, szFullPath); else - SetMidiPercussion((DWORD)modItemDropID, szFullPath); + SetMidiPercussion(modItemDropID, szFullPath); } return true; } @@ -2450,7 +2447,7 @@ BOOL bSep = FALSE; const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); const uint32 modItemID = GetModItemID(modItem); SelectItem(hItem); @@ -2664,7 +2661,7 @@ if (hItem != NULL) { const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); const uint32 modItemID = GetModItemID(modItem); switch(modItemType) @@ -2914,7 +2911,7 @@ CModDoc *pModDoc; const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); const uint32 modItemID = GetModItemID(modItem); pModDoc = GetDocumentFromItem(hItem); @@ -2954,7 +2951,7 @@ CModDoc *pModDoc; const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); const uint32 modItemID = GetModItemID(modItem); pModDoc = GetDocumentFromItem(hItem); @@ -2988,7 +2985,7 @@ CModDoc *pModDoc; const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); //const uint32 modItemID = GetModItemID(modItem); pModDoc = GetDocumentFromItem(hItem); @@ -3032,7 +3029,7 @@ HTREEITEM hItem = GetSelectedItem(); const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); const uint32 modItemID = GetModItemID(modItem); CModDoc *pModDoc = GetDocumentFromItem(hItem); @@ -3051,7 +3048,7 @@ } else if(modItemType == MODITEM_SAMPLE) { // Duplicate sample - vector<SAMPLEINDEX> newOrder = GenerateInsertVector<SAMPLEINDEX>(pSndFile->GetNumSamples(), modItemID, modItemID); + vector<SAMPLEINDEX> newOrder = GenerateInsertVector<SAMPLEINDEX>(pSndFile->GetNumSamples(), modItemID, static_cast<SAMPLEINDEX>(modItemID)); if(pModDoc->ReArrangeSamples(newOrder) != SAMPLEINDEX_INVALID) { pModDoc->SetModified(); @@ -3063,7 +3060,7 @@ } else if(modItemType == MODITEM_INSTRUMENT) { // Duplicate instrument - vector<INSTRUMENTINDEX> newOrder = GenerateInsertVector<INSTRUMENTINDEX>(pSndFile->GetNumInstruments(), modItemID, modItemID); + vector<INSTRUMENTINDEX> newOrder = GenerateInsertVector<INSTRUMENTINDEX>(pSndFile->GetNumInstruments(), modItemID, static_cast<INSTRUMENTINDEX>(modItemID)); if(pModDoc->ReArrangeInstruments(newOrder) != INSTRUMENTINDEX_INVALID) { pModDoc->UpdateAllViews(NULL, HINT_INSNAMES | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_PATTERNDATA); @@ -3083,7 +3080,7 @@ HTREEITEM hItem = GetSelectedItem(); const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); const uint32 modItemID = GetModItemID(modItem); CModDoc *pModDoc = GetDocumentFromItem(hItem); @@ -3133,7 +3130,7 @@ CModDoc *pModDoc; const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); const uint32 modItemID = GetModItemID(modItem); pModDoc = GetDocumentFromItem(hItem); @@ -3260,7 +3257,7 @@ HTREEITEM hItem = HitTest(point, &flags); const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); //const uint32 modItemID = GetModItemID(modItem); switch(modItemType) @@ -3383,7 +3380,7 @@ HTREEITEM hItem = GetSelectedItem(); const uint64 modItem = GetModItem(hItem); - const uint32 modItemType = GetModItemType(modItem); + const ModItemType modItemType = GetModItemType(modItem); const uint32 modItemID = GetModItemID(modItem); if ((modItemType & 0xFFFF) == MODITEM_DLSBANK_FOLDER) @@ -3464,3 +3461,145 @@ CView* pView = pModDoc->GetNextView(pos); if (pView) pView->PostMessage(WM_COMMAND, ID_FILE_CLOSE); } + + +// Editing sample, instrument, order, pattern, etc. labels +void CModTree::OnBeginLabelEdit(NMHDR *nmhdr, LRESULT *result) +//------------------------------------------------------------ +{ + NMTVDISPINFO *info = reinterpret_cast<NMTVDISPINFO *>(nmhdr); + CEdit *editCtrl = GetEditControl(); + const uint64 modItem = GetModItem(info->item.hItem); + const ModItemType modItemType = GetModItemType(modItem); + const uint32 modItemID = GetModItemID(modItem); + const CModDoc *modDoc = GetDocumentFromItem(info->item.hItem); + + if(editCtrl != nullptr && modDoc != nullptr) + { + const CSoundFile *sndFile = modDoc->GetSoundFile(); + const CModSpecifications &modSpecs = sndFile->GetModSpecifications(); + char const *text = nullptr; + CString tempText; + + switch(modItemType) + { + case MODITEM_ORDER: + tempText.Format("%u", sndFile->Order.GetSequence(static_cast<SEQUENCEINDEX>(modItemID >> 16)).At(static_cast<ORDERINDEX>(modItemID & 0xFFFF))); + text = tempText; + break; + + case MODITEM_SEQUENCE: + if(modItemID < sndFile->Order.GetNumSequences()) + { + text = sndFile->Order.GetSequence(static_cast<SEQUENCEINDEX>(modItemID)).m_sName; + } + break; + + case MODITEM_PATTERN: + if(modItemID < sndFile->Patterns.GetNumPatterns() && modSpecs.hasPatternNames) + { + text = sndFile->Patterns[modItemID].GetName(); + editCtrl->SetLimitText(MAX_PATTERNNAME - 1); + } + break; + + case MODITEM_SAMPLE: + if(modItemID <= sndFile->GetNumSamples()) + { + text = sndFile->m_szNames[modItemID]; + editCtrl->SetLimitText(modSpecs.sampleNameLengthMax); + } + break; + + case MODITEM_INSTRUMENT: + if(modItemID <= sndFile->GetNumInstruments() && sndFile->Instruments[modItemID] != nullptr) + { + text = sndFile->Instruments[modItemID]->name; + editCtrl->SetLimitText(modSpecs.instrNameLengthMax); + } + break; + } + + if(text) + { + CMainFrame::GetMainFrame()->GetInputHandler()->Bypass(true); + editCtrl->SetWindowText(text); + *result = FALSE; + return; + } + } + *result = TRUE; +} + + +// End editing sample, instrument, order, pattern, etc. labels +void CModTree::OnEndLabelEdit(NMHDR *nmhdr, LRESULT *result) +//---------------------------------------------------------- +{ + CMainFrame::GetMainFrame()->GetInputHandler()->Bypass(false); + + NMTVDISPINFO *info = reinterpret_cast<NMTVDISPINFO *>(nmhdr); + const uint64 modItem = GetModItem(info->item.hItem); + const ModItemType modItemType = GetModItemType(modItem); + const uint32 modItemID = GetModItemID(modItem); + CModDoc *modDoc = GetDocumentFromItem(info->item.hItem); + + if(info->item.pszText != nullptr && modDoc != nullptr) + { + CSoundFile *sndFile = modDoc->GetSoundFile(); + const CModSpecifications &modSpecs = sndFile->GetModSpecifications(); + + switch(modItemType) + { + case MODITEM_ORDER: + { + PATTERNINDEX pat = ConvertStrTo<PATTERNINDEX>(info->item.pszText); + PATTERNINDEX &target = sndFile->Order.GetSequence(static_cast<SEQUENCEINDEX>(modItemID >> 16)).At(static_cast<ORDERINDEX>(modItemID & 0xFFFF)); + if(pat < sndFile->Patterns.GetNumPatterns() && pat != target) + { + target = pat; + modDoc->SetModified(); + modDoc->UpdateAllViews(NULL, HINT_MODSEQUENCE, NULL); + } + } + break; + + case MODITEM_SEQUENCE: + if(modItemID < sndFile->Order.GetNumSequences() && sndFile->Order.GetSequence(static_cast<SEQUENCEINDEX>(modItemID)).m_sName != info->item.pszText) + { + sndFile->Order.GetSequence(static_cast<SEQUENCEINDEX>(modItemID)).m_sName = info->item.pszText; + modDoc->SetModified(); + modDoc->UpdateAllViews(NULL, HINT_MODSEQUENCE, NULL); + } + break; + + case MODITEM_PATTERN: + if(modItemID < sndFile->Patterns.GetNumPatterns() && modSpecs.hasPatternNames && sndFile->Patterns[modItemID].GetName() != info->item.pszText) + { + sndFile->Patterns[modItemID].SetName(info->item.pszText); + modDoc->SetModified(); + modDoc->UpdateAllViews(NULL, (UINT(modItemID) << HINT_SHIFT_PAT) | HINT_PATTERNDATA | HINT_PATNAMES); + } + break; + + case MODITEM_SAMPLE: + if(modItemID <= sndFile->GetNumSamples() && strcmp(sndFile->m_szNames[modItemID], info->item.pszText)) + { + strncpy(sndFile->m_szNames[modItemID], info->item.pszText, modSpecs.sampleNameLengthMax); + modDoc->SetModified(); + modDoc->UpdateAllViews(NULL, (UINT(modItemID) << HINT_SHIFT_SMP) | HINT_SMPNAMES | HINT_SAMPLEDATA | HINT_SAMPLEINFO); + } + break; + + case MODITEM_INSTRUMENT: + if(modItemID <= sndFile->GetNumInstruments() && sndFile->Instruments[modItemID] != nullptr && strcmp(sndFile->Instruments[modItemID]->name, info->item.pszText)) + { + strncpy(sndFile->Instruments[modItemID]->name, info->item.pszText, modSpecs.instrNameLengthMax); + modDoc->SetModified(); + modDoc->UpdateAllViews(NULL, (UINT(modItemID) << HINT_SHIFT_INS) | HINT_ENVELOPE | HINT_INSTRUMENT); + } + break; + } + } + *result = FALSE; +} Modified: trunk/OpenMPT/mptrack/View_tre.h =================================================================== --- trunk/OpenMPT/mptrack/View_tre.h 2013-01-19 16:50:01 UTC (rev 1503) +++ trunk/OpenMPT/mptrack/View_tre.h 2013-01-20 18:40:43 UTC (rev 1504) @@ -20,34 +20,6 @@ using std::vector; using std::bitset; -enum -{ - MODITEM_NULL = 0, - MODITEM_ORDER, - MODITEM_PATTERN, - MODITEM_SAMPLE, - MODITEM_INSTRUMENT, - MODITEM_COMMENTS, - MODITEM_EFFECT, - MODITEM_HDR_SONG, - MODITEM_HDR_ORDERS, - MODITEM_HDR_PATTERNS, - MODITEM_HDR_SAMPLES, - MODITEM_HDR_INSTRUMENTS, - MODITEM_HDR_INSTRUMENTLIB, - MODITEM_HDR_MIDILIB, - MODITEM_HDR_MIDIGROUP, - MODITEM_MIDIINSTRUMENT, - MODITEM_MIDIPERCUSSION, - MODITEM_INSLIB_FOLDER, - MODITEM_INSLIB_SAMPLE, - MODITEM_INSLIB_INSTRUMENT, - MODITEM_INSLIB_SONG, - MODITEM_DLSBANK_FOLDER, - MODITEM_DLSBANK_INSTRUMENT, - MODITEM_SEQUENCE, -}; - #define TREESTATUS_RDRAG 0x01 #define TREESTATUS_LDRAG 0x02 #define TREESTATUS_SINGLEEXPAND 0x04 @@ -116,6 +88,35 @@ //============================== { protected: + + enum ModItemType + { + MODITEM_NULL = 0, + MODITEM_ORDER, + MODITEM_PATTERN, + MODITEM_SAMPLE, + MODITEM_INSTRUMENT, + MODITEM_COMMENTS, + MODITEM_EFFECT, + MODITEM_HDR_SONG, + MODITEM_HDR_ORDERS, + MODITEM_HDR_PATTERNS, + MODITEM_HDR_SAMPLES, + MODITEM_HDR_INSTRUMENTS, + MODITEM_HDR_INSTRUMENTLIB, + MODITEM_HDR_MIDILIB, + MODITEM_HDR_MIDIGROUP, + MODITEM_MIDIINSTRUMENT, + MODITEM_MIDIPERCUSSION, + MODITEM_INSLIB_FOLDER, + MODITEM_INSLIB_SAMPLE, + MODITEM_INSLIB_INSTRUMENT, + MODITEM_INSLIB_SONG, + MODITEM_DLSBANK_FOLDER, + MODITEM_DLSBANK_INSTRUMENT, + MODITEM_SEQUENCE, + }; + CSoundFile m_SongFile; CModTreeDropTarget m_DropTarget; CModTree *m_pDataTree; @@ -148,7 +149,7 @@ void EmptyInstrumentLibrary(); void FillInstrumentLibrary(); uint64 GetModItem(HTREEITEM hItem); - uint32 GetModItemType(const uint64 modItem) {return static_cast<uint32>(modItem & 0xFFFF);}; // return "item type" part of mod item variable ( & 0xFFFF ) + ModItemType GetModItemType(const uint64 modItem) {return static_cast<ModItemType>(modItem & 0xFFFF);}; // return "item type" part of mod item variable ( & 0xFFFF ) uint32 GetModItemID(const uint64 modItem) {return static_cast<uint32>(modItem >> 16);}; // return "item ID" part of mod item variable ( >> 16 ) BOOL SetMidiInstrument(UINT nIns, LPCTSTR lpszFileName); BOOL SetMidiPercussion(UINT nPerc, LPCTSTR lpszFileName); @@ -216,6 +217,8 @@ afx_msg void OnInsertTreeItem(); afx_msg void OnSwitchToTreeItem(); // hack for sequence items to avoid double-click action afx_msg void OnCloseItem(); + afx_msg void OnBeginLabelEdit(NMHDR *nmhdr, LRESULT *result); + afx_msg void OnEndLabelEdit(NMHDR *nmhdr, LRESULT *result); // -> CODE#0023 // -> DESC="IT project files (.itp)" Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2013-01-19 16:50:01 UTC (rev 1503) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2013-01-20 18:40:43 UTC (rev 1504) @@ -67,6 +67,7 @@ bool hasRestartPos; bool supportsPlugins; bool hasPatternSignatures; // Can patterns have a custom time signature? + bool hasPatternNames; // Cat patterns have a name? SongFlags songFlags; // Supported song flags }; @@ -116,6 +117,7 @@ true, // Has restart position (order) true, // Supports plugins true, // Custom pattern time signatures + true, // Pattern names SONG_LINEARSLIDES | SONG_EXFILTERRANGE | SONG_ITOLDEFFECTS | SONG_ITCOMPATGXX | SONG_EMBEDMIDICFG, // Supported song flags }; @@ -160,6 +162,7 @@ true, // Has restart position (order) false, // Doesn't support plugins false, // No custom pattern time signatures + false, // No pattern names SONG_PT1XMODE, // Supported song flags }; @@ -179,7 +182,7 @@ 1, // Channel min 32, // Channel max 32, // Min tempo - 255, // Max tempo + 10000, // Max tempo 1, // Min pattern rows 256, // Max pattern rows 20, // Max mod name length @@ -202,6 +205,7 @@ true, // Has restart position (order) false, // Doesn't support plugins false, // No custom pattern time signatures + false, // No pattern names SONG_LINEARSLIDES, // Supported song flags }; @@ -221,7 +225,7 @@ 1, // Channel min 127, // Channel max 32, // Min tempo - 512, // Max tempo + 10000, // Max tempo 1, // Min pattern rows 1024, // Max pattern rows 20, // Max mod name length @@ -244,6 +248,7 @@ true, // Has restart position (order) true, // Supports plugins false, // No custom pattern time signatures + true, // Pattern names SONG_LINEARSLIDES | SONG_EXFILTERRANGE | SONG_EMBEDMIDICFG, // Supported song flags }; @@ -285,6 +290,7 @@ false, // Doesn't have restart position (order) false, // Doesn't support plugins false, // No custom pattern time signatures + false, // No pattern names SONG_FASTVOLSLIDES | SONG_AMIGALIMITS, // Supported song flags }; @@ -327,6 +333,7 @@ false, // Doesn't have restart position (order) false, // Doesn't support plugins false, // No custom pattern time signatures + false, // No pattern names SONG_FASTVOLSLIDES | SONG_AMIGALIMITS, // Supported song flags }; @@ -368,6 +375,7 @@ false, // Doesn't have restart position (order) false, // Doesn't support plugins false, // No custom pattern time signatures + false, // No pattern names SONG_LINEARSLIDES | SONG_ITOLDEFFECTS | SONG_ITCOMPATGXX | SONG_EMBEDMIDICFG, // Supported song flags }; @@ -409,6 +417,7 @@ false, // Doesn't have restart position (order) true, // Supports plugins false, // No custom pattern time signatures + true, // Pattern names SONG_LINEARSLIDES | SONG_EXFILTERRANGE | SONG_ITOLDEFFECTS | SONG_ITCOMPATGXX | SONG_EMBEDMIDICFG | SONG_ITPROJECT | SONG_ITPEMBEDIH, // Supported song flags }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-01-22 15:27:21
|
Revision: 1507 http://sourceforge.net/p/modplug/code/1507 Author: saga-games Date: 2013-01-22 15:27:14 +0000 (Tue, 22 Jan 2013) Log Message: ----------- [Imp] Sample Editor: Sustain loop preview is now updated instantly (http://bugs.openmpt.org/view.php?id=108). Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/soundlib/modsmp_ctrl.cpp trunk/OpenMPT/soundlib/modsmp_ctrl.h Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2013-01-22 15:01:28 UTC (rev 1506) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2013-01-22 15:27:14 UTC (rev 1507) @@ -164,7 +164,7 @@ } -CCtrlSamples::CCtrlSamples() : +CCtrlSamples::CCtrlSamples() : //---------------------------- m_nStretchProcessStepLength(nDefaultStretchChunkSize), m_nSequenceMs(DEFAULT_SEQUENCE_MS), @@ -2665,14 +2665,14 @@ { if ((IsLocked()) || (!m_pSndFile)) return; ModSample &sample = m_pSndFile->GetSample(m_nSample); - LONG n = GetDlgItemInt(IDC_EDIT1); - if ((n >= 0) && (n < (LONG)sample.nLength) && ((n < (LONG)sample.nLoopEnd) || (!(sample.uFlags & CHN_LOOP)))) + SmpLength n = GetDlgItemInt(IDC_EDIT1); + if ((n >= 0) && (n < sample.nLength) && ((n < sample.nLoopEnd) || !sample.uFlags[CHN_LOOP])) { sample.nLoopStart = n; - if(sample.uFlags & CHN_LOOP) + if(sample.uFlags[CHN_LOOP]) { - /* only update sample buffer if the loop is actually enabled - (resets sound without any reason otherwise) - http://forum.openmpt.org/index.php?topic=1874.0 */ + // only update sample buffer if the loop is actually enabled + // (resets sound without any reason otherwise) - http://forum.openmpt.org/index.php?topic=1874.0 m_pModDoc->AdjustEndOfSample(m_nSample); } m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); @@ -2686,14 +2686,14 @@ { if ((IsLocked()) || (!m_pSndFile)) return; ModSample &sample = m_pSndFile->GetSample(m_nSample); - LONG n = GetDlgItemInt(IDC_EDIT2); - if ((n >= 0) && (n <= (LONG)sample.nLength) && ((n > (LONG)sample.nLoopStart) || (!(sample.uFlags & CHN_LOOP)))) + SmpLength n = GetDlgItemInt(IDC_EDIT2); + if ((n >= 0) && (n <= sample.nLength) && ((n > sample.nLoopStart) || !sample.uFlags[CHN_LOOP])) { sample.nLoopEnd = n; - if(sample.uFlags & CHN_LOOP) + if(sample.uFlags[CHN_LOOP]) { - /* only update sample buffer if the loop is actually enabled - (resets sound without any reason otherwise) - http://forum.openmpt.org/index.php?topic=1874.0 */ + // only update sample buffer if the loop is actually enabled + // (resets sound without any reason otherwise) - http://forum.openmpt.org/index.php?topic=1874.0 m_pModDoc->AdjustEndOfSample(m_nSample); } m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); @@ -2745,11 +2745,12 @@ { if ((IsLocked()) || (!m_pSndFile)) return; ModSample &sample = m_pSndFile->GetSample(m_nSample); - LONG n = GetDlgItemInt(IDC_EDIT3); - if ((n >= 0) && (n <= (LONG)sample.nLength) - && ((n < (LONG)sample.nSustainEnd) || (!(sample.uFlags & CHN_SUSTAINLOOP)))) + SmpLength n = GetDlgItemInt(IDC_EDIT3); + if ((n >= 0) && (n <= sample.nLength) + && ((n < sample.nSustainEnd) || !sample.uFlags[CHN_SUSTAINLOOP])) { sample.nSustainStart = n; + ctrlSmp::UpdateLoopPoints(sample, *m_pSndFile); m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); m_pModDoc->SetModified(); } @@ -2761,11 +2762,12 @@ { if ((IsLocked()) || (!m_pSndFile)) return; ModSample &sample = m_pSndFile->GetSample(m_nSample); - LONG n = GetDlgItemInt(IDC_EDIT4); - if ((n >= 0) && (n <= (LONG)sample.nLength) - && ((n > (LONG)sample.nSustainStart) || (!(sample.uFlags & CHN_SUSTAINLOOP)))) + SmpLength n = GetDlgItemInt(IDC_EDIT4); + if ((n >= 0) && (n <= sample.nLength) + && ((n > sample.nSustainStart) || !sample.uFlags[CHN_SUSTAINLOOP])) { sample.nSustainEnd = n; + ctrlSmp::UpdateLoopPoints(sample, *m_pSndFile); m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); m_pModDoc->SetModified(); } Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.cpp =================================================================== --- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2013-01-22 15:01:28 UTC (rev 1506) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2013-01-22 15:27:14 UTC (rev 1507) @@ -24,11 +24,11 @@ LPSTR const pOldSmp = smp.pSample; FlagSet<ChannelFlags> setFlags, resetFlags; - setFlags.set(CHN_16BIT, (smp.uFlags & CHN_16BIT) != 0); - resetFlags.set(CHN_16BIT, (smp.uFlags & CHN_16BIT) == 0); + setFlags.set(CHN_16BIT, smp.uFlags[CHN_16BIT]); + resetFlags.set(CHN_16BIT, !smp.uFlags[CHN_16BIT]); - setFlags.set(CHN_STEREO, (smp.uFlags & CHN_STEREO) != 0); - resetFlags.set(CHN_STEREO, (smp.uFlags & CHN_STEREO) == 0); + setFlags.set(CHN_STEREO, smp.uFlags[CHN_STEREO]); + resetFlags.set(CHN_STEREO, !smp.uFlags[CHN_STEREO]); CriticalSection cs; @@ -189,28 +189,57 @@ // Update channels with new loop values if(pSndFile != nullptr) { - CSoundFile& rSndFile = *pSndFile; - for(CHANNELINDEX i = 0; i < MAX_CHANNELS; i++) if ((rSndFile.Chn[i].pModSample == &smp) && rSndFile.Chn[i].nLength != 0) + return UpdateLoopPoints(smp, *pSndFile); + } + + return true; +} + + +// Propagate loop point changes to player +bool UpdateLoopPoints(const ModSample &smp, CSoundFile &sf) +//--------------------------------------------------------- +{ + if(!smp.nLength || !smp.pSample) + return false; + + CriticalSection cs; + + // Update channels with new loop values + for(CHANNELINDEX i = 0; i < MAX_CHANNELS; i++) if((sf.Chn[i].pModSample == &smp) && sf.Chn[i].nLength != 0) + { + bool looped = false, bidi = false; + + if(smp.nSustainStart < smp.nSustainEnd && smp.nSustainEnd <= smp.nLength && smp.uFlags[CHN_SUSTAINLOOP] && !sf.Chn[i].dwFlags[CHN_KEYOFF]) { - if((smp.nLoopStart + 3 < smp.nLoopEnd) && (smp.nLoopEnd <= smp.nLength)) - { - rSndFile.Chn[i].nLoopStart = smp.nLoopStart; - rSndFile.Chn[i].nLoopEnd = smp.nLoopEnd; - rSndFile.Chn[i].nLength = smp.nLoopEnd; - if(rSndFile.Chn[i].nPos > rSndFile.Chn[i].nLength) - { - rSndFile.Chn[i].nPos = rSndFile.Chn[i].nLoopStart; - rSndFile.Chn[i].dwFlags.reset(CHN_PINGPONGFLAG); - } + // Sustain loop is active + sf.Chn[i].nLoopStart = smp.nSustainStart; + sf.Chn[i].nLoopEnd = smp.nSustainEnd; + sf.Chn[i].nLength = smp.nSustainEnd; + looped = true; + bidi = smp.uFlags[CHN_PINGPONGSUSTAIN]; + } else if(smp.nLoopStart < smp.nLoopEnd && smp.nLoopEnd <= smp.nLength && smp.uFlags[CHN_LOOP]) + { + // Normal loop is active + sf.Chn[i].nLoopStart = smp.nLoopStart; + sf.Chn[i].nLoopEnd = smp.nLoopEnd; + sf.Chn[i].nLength = smp.nLoopEnd; + looped = true; + bidi = smp.uFlags[CHN_PINGPONGLOOP]; + } + sf.Chn[i].dwFlags.set(CHN_LOOP, looped); + sf.Chn[i].dwFlags.set(CHN_PINGPONGLOOP, looped && bidi); - bool looped = (smp.uFlags & CHN_LOOP) != 0; - rSndFile.Chn[i].dwFlags.set(CHN_LOOP, looped); - rSndFile.Chn[i].dwFlags.set(CHN_PINGPONGLOOP, looped && (smp.uFlags & CHN_PINGPONGLOOP)); - } else if (!(smp.uFlags & CHN_LOOP)) - { - rSndFile.Chn[i].dwFlags.reset(CHN_PINGPONGLOOP | CHN_LOOP); - } + if(sf.Chn[i].nPos > sf.Chn[i].nLength) + { + sf.Chn[i].nPos = sf.Chn[i].nLoopStart; + sf.Chn[i].dwFlags.reset(CHN_PINGPONGFLAG); } + + if(!looped) + { + sf.Chn[i].nLength = smp.nLength; + } } return true; Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.h =================================================================== --- trunk/OpenMPT/soundlib/modsmp_ctrl.h 2013-01-22 15:01:28 UTC (rev 1506) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.h 2013-01-22 15:27:14 UTC (rev 1507) @@ -38,6 +38,9 @@ bool AdjustEndOfSample(ModSample &smp, CSoundFile *pSndFile = nullptr); +// Propagate loop point changes to player +bool UpdateLoopPoints(const ModSample &smp, CSoundFile &sf); + // Returns the number of bytes allocated(at least) for sample data. // Note: Currently the return value is based on the sample length and the actual // allocation may be more than what this function returns. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-01-25 00:01:18
|
Revision: 1508 http://sourceforge.net/p/modplug/code/1508 Author: saga-games Date: 2013-01-25 00:01:06 +0000 (Fri, 25 Jan 2013) Log Message: ----------- [Imp] Treeview: Entering +++ and --- patterns in the order list does work now. [Mod] Sample Editor: 8-Bit/Mono conversion is now also shown in the context menu if a selection has been made. [Mod] OpenMPT: Version is now 1.21.01.08 Modified Paths: -------------- trunk/OpenMPT/common/version.h trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/View_tre.h Modified: trunk/OpenMPT/common/version.h =================================================================== --- trunk/OpenMPT/common/version.h 2013-01-22 15:27:14 UTC (rev 1507) +++ trunk/OpenMPT/common/version.h 2013-01-25 00:01:06 UTC (rev 1508) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 21 #define VER_MINOR 01 -#define VER_MINORMINOR 07 +#define VER_MINORMINOR 08 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2013-01-22 15:27:14 UTC (rev 1507) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2013-01-25 00:01:06 UTC (rev 1508) @@ -1528,18 +1528,15 @@ } } - if(m_dwBeginSel >= m_dwEndSel) + if(sample.GetElementarySampleSize() > 1) ::AppendMenu(hMenu, MF_STRING, ID_SAMPLE_8BITCONVERT, "Convert to &8-bit\t" + ih->GetKeyTextFromCommand(kcSample8Bit)); + if(sample.GetNumChannels() > 1) { - if(sample.GetElementarySampleSize() > 1) ::AppendMenu(hMenu, MF_STRING, ID_SAMPLE_8BITCONVERT, "Convert to &8-bit\t" + ih->GetKeyTextFromCommand(kcSample8Bit)); - if(sample.GetNumChannels() > 1) - { - HMENU hMonoMenu = ::CreatePopupMenu(); - ::AppendMenu(hMonoMenu, MF_STRING, ID_SAMPLE_MONOCONVERT, "&Mix Channels\t" + ih->GetKeyTextFromCommand(kcSampleMonoMix)); - ::AppendMenu(hMonoMenu, MF_STRING, ID_SAMPLE_MONOCONVERT_LEFT, "&Left Channel\t" + ih->GetKeyTextFromCommand(kcSampleMonoLeft)); - ::AppendMenu(hMonoMenu, MF_STRING, ID_SAMPLE_MONOCONVERT_RIGHT, "&Right Channel\t" + ih->GetKeyTextFromCommand(kcSampleMonoRight)); - ::AppendMenu(hMonoMenu, MF_STRING, ID_SAMPLE_MONOCONVERT_SPLIT, "&Split Sample\t" + ih->GetKeyTextFromCommand(kcSampleMonoSplit)); - ::AppendMenu(hMenu, MF_POPUP, reinterpret_cast<UINT_PTR>(hMonoMenu), "Convert to &Mono"); - } + HMENU hMonoMenu = ::CreatePopupMenu(); + ::AppendMenu(hMonoMenu, MF_STRING, ID_SAMPLE_MONOCONVERT, "&Mix Channels\t" + ih->GetKeyTextFromCommand(kcSampleMonoMix)); + ::AppendMenu(hMonoMenu, MF_STRING, ID_SAMPLE_MONOCONVERT_LEFT, "&Left Channel\t" + ih->GetKeyTextFromCommand(kcSampleMonoLeft)); + ::AppendMenu(hMonoMenu, MF_STRING, ID_SAMPLE_MONOCONVERT_RIGHT, "&Right Channel\t" + ih->GetKeyTextFromCommand(kcSampleMonoRight)); + ::AppendMenu(hMonoMenu, MF_STRING, ID_SAMPLE_MONOCONVERT_SPLIT, "&Split Sample\t" + ih->GetKeyTextFromCommand(kcSampleMonoSplit)); + ::AppendMenu(hMenu, MF_POPUP, reinterpret_cast<UINT_PTR>(hMonoMenu), "Convert to &Mono"); } // "Trim" menu item is responding differently if there's no selection, Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2013-01-22 15:27:14 UTC (rev 1507) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2013-01-25 00:01:06 UTC (rev 1508) @@ -296,8 +296,7 @@ } } - ModTreeDocInfo *pInfo = new ModTreeDocInfo(pModDoc->GetSoundFile()); - pInfo->pModDoc = pModDoc; + ModTreeDocInfo *pInfo = new ModTreeDocInfo(*pModDoc->GetSoundFile()); pInfo->nSeqSel = SEQUENCEINDEX_INVALID; pInfo->nOrdSel = ORDERINDEX_INVALID; DocInfo.push_back(pInfo); @@ -969,7 +968,7 @@ || ((!pSndFile->Instruments[smin]) && (pInfo->tiInstruments[smin] != NULL))) { smax = MAX_INSTRUMENTS-1; - for (UINT iRem=smin; iRem<smax; iRem++) + for (INSTRUMENTINDEX iRem=smin; iRem<smax; iRem++) { if (pInfo->tiInstruments[iRem]) { @@ -1031,7 +1030,7 @@ LPARAM lParam; HTREEITEM hItemParent, hItemParentParent, hRootParent; - if (!hItem) return 0; + if (!hItem) return MODITEM_NULL; // First, test root items if (hItem == m_hInsLib) return MODITEM_HDR_INSTRUMENTLIB; if (hItem == m_hMidiLib) return MODITEM_HDR_MIDILIB; @@ -1301,21 +1300,18 @@ if (m_szSongName[0]) { // Preview sample / instrument in module - CHAR szName[64]; + char szName[16]; lstrcpyn(szName, GetItemText(hItem), sizeof(szName)); - UINT n = 0; - if (szName[0] >= '0') n += (szName[0] - '0'); - if ((szName[1] >= '0') && (szName[1] <= '9')) n = n*10 + (szName[1] - '0'); - if ((szName[2] >= '0') && (szName[2] <= '9')) n = n*10 + (szName[2] - '0'); + const size_t n = ConvertStrTo<size_t>(szName); CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); if (pMainFrm) { if (modItemType == MODITEM_INSLIB_INSTRUMENT) { - pMainFrm->PlaySoundFile(&m_SongFile, n, 0, nParam); + pMainFrm->PlaySoundFile(&m_SongFile, static_cast<INSTRUMENTINDEX>(n), SAMPLEINDEX_INVALID, nParam); } else { - pMainFrm->PlaySoundFile(&m_SongFile, 0, n, nParam); + pMainFrm->PlaySoundFile(&m_SongFile, INSTRUMENTINDEX_INVALID, static_cast<SAMPLEINDEX>(n), nParam); } } } else @@ -1881,7 +1877,7 @@ if ((!lpszDir) || (!lpszDir[0])) return FALSE; BeginWaitCursor(); - if (!GetCurrentDirectory(sizeof(s), s)) s[0] = 0; + if (!GetCurrentDirectory(CountOf(s), s)) s[0] = 0; if (!strcmp(lpszDir+1, ":\\")) { sdrive[0] = lpszDir[0]; @@ -3484,8 +3480,16 @@ switch(modItemType) { case MODITEM_ORDER: - tempText.Format("%u", sndFile->Order.GetSequence(static_cast<SEQUENCEINDEX>(modItemID >> 16)).At(static_cast<ORDERINDEX>(modItemID & 0xFFFF))); - text = tempText; + { + PATTERNINDEX pat = sndFile->Order.GetSequence(static_cast<SEQUENCEINDEX>(modItemID >> 16)).At(static_cast<ORDERINDEX>(modItemID & 0xFFFF)); + if(pat == sndFile->Order.GetInvalidPatIndex()) + tempText = "---"; + else if(pat == sndFile->Order.GetIgnoreIndex()) + tempText = "+++"; + else + tempText.Format("%u", pat); + text = tempText; + } break; case MODITEM_SEQUENCE: @@ -3552,10 +3556,25 @@ switch(modItemType) { case MODITEM_ORDER: + if(info->item.pszText[0]) { PATTERNINDEX pat = ConvertStrTo<PATTERNINDEX>(info->item.pszText); + bool valid = true; + if(info->item.pszText[0] == '-') + { + pat = sndFile->Order.GetInvalidPatIndex(); + } else if(info->item.pszText[0] == '+') + { + if(modSpecs.hasIgnoreIndex) + pat = sndFile->Order.GetIgnoreIndex(); + else + valid = false; + } else + { + valid = (pat < sndFile->Patterns.GetNumPatterns()); + } PATTERNINDEX &target = sndFile->Order.GetSequence(static_cast<SEQUENCEINDEX>(modItemID >> 16)).At(static_cast<ORDERINDEX>(modItemID & 0xFFFF)); - if(pat < sndFile->Patterns.GetNumPatterns() && pat != target) + if(valid && pat != target) { target = pat; modDoc->SetModified(); Modified: trunk/OpenMPT/mptrack/View_tre.h =================================================================== --- trunk/OpenMPT/mptrack/View_tre.h 2013-01-22 15:27:14 UTC (rev 1507) +++ trunk/OpenMPT/mptrack/View_tre.h 2013-01-25 00:01:06 UTC (rev 1508) @@ -25,8 +25,6 @@ #define TREESTATUS_SINGLEEXPAND 0x04 #define TREESTATUS_DRAGGING (TREESTATUS_RDRAG|TREESTATUS_LDRAG) -#define MODTREE_MAX_DOCUMENTS 32 - struct ModTreeDocInfo { CModDoc *pModDoc; @@ -44,18 +42,15 @@ bitset<MAX_SAMPLES> samplesPlaying; bitset<MAX_INSTRUMENTS> instrumentsPlaying; - ModTreeDocInfo(const CSoundFile* const pSndFile) + ModTreeDocInfo(const CSoundFile &sndFile) { - pModDoc = NULL; + pModDoc = sndFile.GetpModDoc(); nSeqSel = SEQUENCEINDEX_INVALID; nOrdSel = ORDERINDEX_INVALID; - hSong = hPatterns = hSamples = hInstruments = hComments = hOrders = hEffects = NULL; - if(pSndFile != NULL) - { - tiPatterns.resize(pSndFile->Patterns.Size(), NULL); - tiOrders.resize(pSndFile->Order.GetNumSequences()); - tiSequences.resize(pSndFile->Order.GetNumSequences(), NULL); - } + hSong = hPatterns = hSamples = hInstruments = hComments = hOrders = hEffects = nullptr; + tiPatterns.resize(sndFile.Patterns.Size(), nullptr); + tiOrders.resize(sndFile.Order.GetNumSequences()); + tiSequences.resize(sndFile.Order.GetNumSequences(), nullptr); MemsetZero(tiSamples); MemsetZero(tiInstruments); MemsetZero(tiEffects); @@ -132,6 +127,7 @@ HTREEITEM m_tiPerc[128]; vector<HTREEITEM> m_tiDLS; vector<ModTreeDocInfo *> DocInfo; + // Instrument library CHAR m_szInstrLibPath[_MAX_PATH], m_szOldPath[_MAX_PATH], m_szSongName[_MAX_PATH]; public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-01-30 16:58:42
|
Revision: 1509 http://sourceforge.net/p/modplug/code/1509 Author: saga-games Date: 2013-01-30 16:58:33 +0000 (Wed, 30 Jan 2013) Log Message: ----------- [Imp] Elapsed time in status bar is a lot more accurate now. [Imp] Comments page: Editing sample/instrument names limits the name length during input instead of just trimming long strings afterwards. [Mod] Changed default song name to be empty instead of "untitled" (suggestion by coda) [Int] Changed FileReader::ReadVector behaviour if not enough bytes can be read, to prevent possible heap corruptions when not checking for the ReadVector result. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/view_com.cpp trunk/OpenMPT/mptrack/view_com.h trunk/OpenMPT/soundlib/FileReader.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2013-01-25 00:01:06 UTC (rev 1508) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2013-01-30 16:58:33 UTC (rev 1509) @@ -224,7 +224,6 @@ m_hWndMidi = NULL; m_pSndFile = nullptr; m_dwStatus = 0; - m_dwElapsedTime = 0; m_dwTimeSec = 0; m_dwNotifyType = 0; m_nTimer = 0; @@ -1021,7 +1020,6 @@ BOOL CMainFrame::DoNotification(DWORD dwSamplesRead, DWORD dwLatency) //------------------------------------------------------------------- { - m_dwElapsedTime += (dwSamplesRead * 1000) / GetSettings().m_dwRate; gsdwTotalSamples += dwSamplesRead; if (!m_pSndFile) return FALSE; if (m_nMixChn < m_pSndFile->m_nMixStat) m_nMixChn++; @@ -1324,8 +1322,8 @@ // Select correct bidi loop mode when playing a module. pSndFile->SetupITBidiMode(); - if ((m_pSndFile) || (m_dwStatus & MODSTATUS_PLAYING)) PauseMod(); - if (((m_pSndFile) && (pSndFile != m_pSndFile)) || (!m_dwElapsedTime)) CSoundFile::ResetAGC(); + if(m_pSndFile != nullptr || (m_dwStatus & MODSTATUS_PLAYING)) PauseMod(); + if(m_pSndFile != nullptr && (pSndFile != m_pSndFile || !m_pSndFile->GetTotalSampleCount())) CSoundFile::ResetAGC(); m_pSndFile = pSndFile; m_pModPlaying = pModDoc; m_hFollowSong = hPat; @@ -1439,7 +1437,6 @@ PauseMod(); if (pPlay) pPlay->SetPause(FALSE); if (pSndFile) pSndFile->SetCurrentPos(0); - m_dwElapsedTime = 0; return TRUE; } @@ -1981,10 +1978,15 @@ //---------------------------- { // Display Time in status bar - DWORD dwTime = m_dwElapsedTime / 1000; - if (dwTime != m_dwTimeSec) + size_t time = 0; + if(m_pSndFile != nullptr && m_pSndFile->GetSampleRate() != 0) { - m_dwTimeSec = dwTime; + time = m_pSndFile->GetTotalSampleCount() / m_pSndFile->GetSampleRate(); + } + + if (time != m_dwTimeSec) + { + m_dwTimeSec = time; m_nAvgMixChn = m_nMixChn; OnUpdateTime(NULL); } @@ -2096,20 +2098,18 @@ { CHAR s[64]; wsprintf(s, "%d:%02d:%02d", - m_dwTimeSec / 3600, (m_dwTimeSec / 60) % 60, (m_dwTimeSec % 60)); - if ((m_pSndFile) && (!(m_pSndFile->IsPaused()))) + m_dwTimeSec / 3600, (m_dwTimeSec / 60) % 60, m_dwTimeSec % 60); + + if(m_pSndFile != nullptr && m_pSndFile != &m_WaveFile && !m_pSndFile->IsPaused()) { - if (m_pSndFile != &m_WaveFile) + PATTERNINDEX nPat = m_pSndFile->m_nPattern; + if(m_pSndFile->Patterns.IsValidIndex(nPat)) { - UINT nPat = m_pSndFile->m_nPattern; - if(nPat < m_pSndFile->Patterns.Size()) - { - if (nPat < 10) strcat(s, " "); - if (nPat < 100) strcat(s, " "); - wsprintf(s+strlen(s), " [%d]", nPat); - } + if(nPat < 10) strcat(s, " "); + if(nPat < 100) strcat(s, " "); + wsprintf(s + strlen(s), " [%d]", nPat); } - wsprintf(s+strlen(s), " %dch", m_nAvgMixChn); + wsprintf(s + strlen(s), " %dch", m_nAvgMixChn); } m_wndStatusBar.SetPaneText(m_wndStatusBar.CommandToIndex(ID_INDICATOR_TIME), s, TRUE); } Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2013-01-25 00:01:06 UTC (rev 1508) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2013-01-30 16:58:33 UTC (rev 1509) @@ -553,15 +553,12 @@ BOOL StopMod(CModDoc *pDoc=NULL); BOOL PauseMod(CModDoc *pDoc=NULL); BOOL PlaySoundFile(CSoundFile *); - BOOL PlaySoundFile(LPCSTR lpszFileName, UINT nNote=0); + BOOL PlaySoundFile(LPCSTR lpszFileName, UINT nNote = 0); BOOL PlaySoundFile(CSoundFile *pSong, UINT nInstrument, UINT nSample, UINT nNote=0); BOOL PlayDLSInstrument(UINT nDLSBank, UINT nIns, UINT nRgn); BOOL StopSoundFile(CSoundFile *); inline BOOL IsPlaying() const { return (m_dwStatus & MODSTATUS_PLAYING); } inline BOOL IsRendering() const { return (m_dwStatus & MODSTATUS_RENDERING); } //rewbs.VSTTimeInfo - DWORD GetElapsedTime() const { return m_dwElapsedTime; } - void ResetElapsedTime() { m_dwElapsedTime = 0; } - void SetElapsedTime(DWORD dwElapsedTime) { m_dwElapsedTime = dwElapsedTime; } inline CModDoc *GetModPlaying() const { return (IsPlaying()||IsRendering()) ? m_pModPlaying : NULL; } inline CSoundFile *GetSoundFilePlaying() const { return (IsPlaying()||IsRendering()) ? m_pSndFile : NULL; } //rewbs.VSTTimeInfo BOOL InitRenderer(CSoundFile*); //rewbs.VSTTimeInfo Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2013-01-25 00:01:06 UTC (rev 1508) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2013-01-30 16:58:33 UTC (rev 1509) @@ -693,7 +693,7 @@ } MemsetZero(m_SndFile.m_szNames); - strcpy(m_SndFile.m_szNames[0], "untitled"); + //strcpy(m_SndFile.m_szNames[0], "untitled"); m_SndFile.m_nMusicTempo = m_SndFile.m_nDefaultTempo = 125; m_SndFile.m_nMusicSpeed = m_SndFile.m_nDefaultSpeed = 6; @@ -803,9 +803,9 @@ { CString strMsg; va_list args; - va_start(args, pszFormat); + va_start(args, pszFormat); strMsg.FormatV(pszFormat, args); - va_end(args); + va_end(args); m_logEvents << Util::sdTime::GetDateTimeStr() << _T("Event type: ") << eventType << std::endl @@ -902,8 +902,8 @@ { CriticalSection cs; - //OnPlayerPause(); // pause song - pausing VSTis is too slow - pMainFrm->SetLastMixActiveTime(); // mark activity + //OnPlayerPause(); // pause song - pausing VSTis is too slow + pMainFrm->SetLastMixActiveTime(); // mark activity // All notes off for (UINT i=0; i<MAX_CHANNELS; i++) @@ -1987,7 +1987,6 @@ m_SndFile.m_SongFlags.reset(SONG_STEP | SONG_PATTERNLOOP); m_SndFile.SetCurrentPos(0); m_SndFile.visitedSongRows.Initialize(true); - pMainFrm->ResetElapsedTime(); m_SndFile.m_lTotalSampleCount = 0; m_SndFile.m_bPositionChanged = true; @@ -2104,13 +2103,13 @@ //----------------------------- { const PATTERNINDEX pat = InsertPattern(); - if (pat >= 0) + if(pat != PATTERNINDEX_INVALID) { ORDERINDEX ord = 0; - for (ORDERINDEX i = 0; i < m_SndFile.Order.size(); i++) + for(ORDERINDEX i = 0; i < m_SndFile.Order.size(); i++) { - if (m_SndFile.Order[i] == pat) ord = i; - if (m_SndFile.Order[i] == m_SndFile.Order.GetInvalidPatIndex()) break; + if(m_SndFile.Order[i] == pat) ord = i; + if(m_SndFile.Order[i] == m_SndFile.Order.GetInvalidPatIndex()) break; } ViewPattern(pat, ord); } @@ -2120,16 +2119,16 @@ void CModDoc::OnInsertSample() //---------------------------- { - LONG smp = InsertSample(); - if (smp != SAMPLEINDEX_INVALID) ViewSample(smp); + SAMPLEINDEX smp = InsertSample(); + if(smp != SAMPLEINDEX_INVALID) ViewSample(smp); } void CModDoc::OnInsertInstrument() //-------------------------------- { - LONG ins = InsertInstrument(); - if (ins != INSTRUMENTINDEX_INVALID) ViewInstrument(ins); + INSTRUMENTINDEX ins = InsertInstrument(); + if(ins != INSTRUMENTINDEX_INVALID) ViewInstrument(ins); } @@ -2303,7 +2302,7 @@ // set playback timer in the status bar (and update channel status) SetElapsedTime(nOrd, 0); - if (pModPlaying == this) + if(pModPlaying == this) { pSndFile->StopAllVsti(); } else @@ -2313,7 +2312,7 @@ cs.Leave(); - if (pModPlaying != this) + if(pModPlaying != this) { pMainFrm->PlayMod(this, followSonghWnd, m_dwNotifyType|MPTNOTIFY_POSITION|MPTNOTIFY_VUMETERS); //rewbs.fix2977 } @@ -2361,7 +2360,7 @@ // set playback timer in the status bar (and update channel status) SetElapsedTime(nOrd, nRow); - if (pModPlaying == this) + if(pModPlaying == this) { pSndFile->StopAllVsti(); } else @@ -2371,7 +2370,7 @@ cs.Leave(); - if (pModPlaying != this) + if(pModPlaying != this) { pMainFrm->PlayMod(this, followSonghWnd, m_dwNotifyType|MPTNOTIFY_POSITION|MPTNOTIFY_VUMETERS); //rewbs.fix2977 } @@ -2422,7 +2421,7 @@ // set playback timer in the status bar (and update channel status) SetElapsedTime(nOrd, nRow); - if (pModPlaying == this) + if(pModPlaying == this) { pSndFile->StopAllVsti(); } else @@ -2432,7 +2431,7 @@ cs.Leave(); - if (pModPlaying != this) + if(pModPlaying != this) { pMainFrm->PlayMod(this, followSonghWnd, m_dwNotifyType|MPTNOTIFY_POSITION|MPTNOTIFY_VUMETERS); //rewbs.fix2977 } @@ -2678,12 +2677,7 @@ void CModDoc::SetElapsedTime(ORDERINDEX nOrd, ROWINDEX nRow) //---------------------------------------------------------- { - const double dPatternPlaytime = m_SndFile.GetPlaybackTimeAt(nOrd, nRow, true); - CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - if(pMainFrm != nullptr) - { - pMainFrm->SetElapsedTime(static_cast<DWORD>(Util::Max(0.0, dPatternPlaytime) * 1000.0)); - } + m_SndFile.GetPlaybackTimeAt(nOrd, nRow, true); } Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2013-01-25 00:01:06 UTC (rev 1508) +++ trunk/OpenMPT/mptrack/mptrack.rc 2013-01-30 16:58:33 UTC (rev 1509) @@ -243,7 +243,6 @@ CONTROL "&Surround",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_TABSTOP,192,54,42,12 END - IDD_INPUT DIALOGEX 0, 0, 166, 66 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTERMOUSE | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "OpenMPT" @@ -630,8 +629,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - EDITTEXT IDC_EDIT_SONGTITLE,2,3,167,12,ES_AUTOHSCROLL - CTEXT "Type EXT, ## channels",IDC_EDIT_MODTYPE,174,3,156,12,SS_CENTERIMAGE,WS_EX_STATICEDGE + LTEXT "Name:",IDC_STATIC,2,5,23,8 + EDITTEXT IDC_EDIT_SONGTITLE,30,3,156,12,ES_AUTOHSCROLL + CTEXT "Type EXT, ## channels",IDC_EDIT_MODTYPE,192,3,138,12,SS_CENTERIMAGE,WS_EX_STATICEDGE GROUPBOX "",IDC_STATIC,1,14,83,82 LTEXT "Initial tempo:",IDC_STATIC,5,20,44,8 CONTROL "",IDC_SLIDER_SONGTEMPO,"msctls_trackbar32",TBS_VERT | TBS_BOTH | TBS_NOTICKS,11,28,15,50 Modified: trunk/OpenMPT/mptrack/view_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/view_com.cpp 2013-01-25 00:01:06 UTC (rev 1508) +++ trunk/OpenMPT/mptrack/view_com.cpp 2013-01-30 16:58:33 UTC (rev 1509) @@ -99,7 +99,8 @@ ON_COMMAND(IDC_LIST_SAMPLES, OnShowSamples) ON_COMMAND(IDC_LIST_INSTRUMENTS, OnShowInstruments) ON_COMMAND(IDC_LIST_PATTERNS, OnShowPatterns) - ON_NOTIFY(LVN_ENDLABELEDIT, IDC_LIST_DETAILS, OnEndLabelEdit) + ON_NOTIFY(LVN_ENDLABELEDIT, IDC_LIST_DETAILS, OnEndLabelEdit) + ON_NOTIFY(LVN_BEGINLABELEDIT, IDC_LIST_DETAILS, OnBeginLabelEdit) ON_NOTIFY(NM_DBLCLK, IDC_LIST_DETAILS, OnDblClickListItem) //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -458,7 +459,7 @@ } -VOID CViewComments::RecalcLayout() +void CViewComments::RecalcLayout() //-------------------------------- { CRect rect; @@ -470,7 +471,7 @@ } -VOID CViewComments::UpdateButtonState() +void CViewComments::UpdateButtonState() //------------------------------------- { CModDoc *pModDoc = GetDocument(); @@ -485,51 +486,55 @@ } -VOID CViewComments::OnEndLabelEdit(LPNMHDR pnmhdr, LRESULT *) +void CViewComments::OnBeginLabelEdit(LPNMHDR, LRESULT *) +//------------------------------------------------------ +{ + CEdit *editCtrl = m_ItemList.GetEditControl(); + if(editCtrl) + { + const CModSpecifications &specs = GetDocument()->GetSoundFile()->GetModSpecifications(); + const size_t maxStrLen = (m_nListId == IDC_LIST_SAMPLES) ? specs.sampleNameLengthMax : specs.instrNameLengthMax; + editCtrl->LimitText(maxStrLen); + } +} + + +void CViewComments::OnEndLabelEdit(LPNMHDR pnmhdr, LRESULT *) //----------------------------------------------------------- { LV_DISPINFO *plvDispInfo = (LV_DISPINFO *)pnmhdr; - LV_ITEM *plvItem = &plvDispInfo->item; + LV_ITEM &lvItem = plvDispInfo->item; CModDoc *pModDoc = GetDocument(); - CHAR s[512]; //rewbs.fix3082 - if ((plvItem->pszText != NULL) && (!plvItem->iSubItem) && (pModDoc)) + if(lvItem.pszText != nullptr && !lvItem.iSubItem && pModDoc) { - UINT iItem = plvItem->iItem; + UINT iItem = lvItem.iItem; CSoundFile *pSndFile = pModDoc->GetSoundFile(); - lstrcpyn(s, plvItem->pszText, sizeof(s)); - size_t maxStrLen = (m_nListId == IDC_LIST_SAMPLES) ? pSndFile->GetModSpecifications().sampleNameLengthMax : pSndFile->GetModSpecifications().instrNameLengthMax; - - for (size_t i = min(maxStrLen, strlen(s)); i < sizeof(s); i++) - s[i] = 0; - - if (m_nListId == IDC_LIST_SAMPLES) + if(m_nListId == IDC_LIST_SAMPLES) { - if (iItem < pSndFile->m_nSamples) + if(iItem < pSndFile->GetNumSamples()) { - memcpy(pSndFile->m_szNames[iItem + 1], s, sizeof(pSndFile->m_szNames[iItem + 1])); + strncpy(pSndFile->m_szNames[iItem + 1], lvItem.pszText, MAX_SAMPLENAME); StringFixer::SetNullTerminator(pSndFile->m_szNames[iItem + 1]); - // 05/01/05 : ericus replaced "<< 24" by "<< 20" : 4000 samples -> 12bits [see Moddoc.h] - pModDoc->UpdateAllViews(this, ((iItem + 1) << HINT_SHIFT_SMP) | (HINT_SMPNAMES|HINT_SAMPLEINFO), this); + pModDoc->UpdateAllViews(this, ((iItem + 1) << HINT_SHIFT_SMP) | (HINT_SMPNAMES | HINT_SAMPLEINFO), this); pModDoc->SetModified(); } - } else - if (m_nListId == IDC_LIST_INSTRUMENTS) + } else if(m_nListId == IDC_LIST_INSTRUMENTS) { - if ((iItem < pSndFile->m_nInstruments) && (pSndFile->Instruments[iItem + 1])) + if((iItem < pSndFile->GetNumInstruments()) && (pSndFile->Instruments[iItem + 1])) { - ModInstrument *pIns = pSndFile->Instruments[iItem+1]; - memcpy(pIns->name, s, sizeof(pIns->name)); + ModInstrument *pIns = pSndFile->Instruments[iItem + 1]; + strncpy(pIns->name, lvItem.pszText, MAX_INSTRUMENTNAME); StringFixer::SetNullTerminator(pIns->name); - pModDoc->UpdateAllViews(this, ((iItem + 1) << HINT_SHIFT_INS) | (HINT_INSNAMES|HINT_INSTRUMENT), this); + pModDoc->UpdateAllViews(this, ((iItem + 1) << HINT_SHIFT_INS) | (HINT_INSNAMES | HINT_INSTRUMENT), this); pModDoc->SetModified(); } } else { return; } - m_ItemList.SetItemText(iItem, plvItem->iSubItem, s); + m_ItemList.SetItemText(iItem, lvItem.iSubItem, lvItem.pszText); } } Modified: trunk/OpenMPT/mptrack/view_com.h =================================================================== --- trunk/OpenMPT/mptrack/view_com.h 2013-01-25 00:01:06 UTC (rev 1508) +++ trunk/OpenMPT/mptrack/view_com.h 2013-01-30 16:58:33 UTC (rev 1509) @@ -54,6 +54,7 @@ afx_msg void OnShowInstruments(); afx_msg void OnShowPatterns(); afx_msg VOID OnEndLabelEdit(LPNMHDR pnmhdr, LRESULT *pLResult); + afx_msg VOID OnBeginLabelEdit(LPNMHDR pnmhdr, LRESULT *pLResult); afx_msg void OnDblClickListItem(NMHDR *, LRESULT *); //}}AFX_MSG DECLARE_MESSAGE_MAP() Modified: trunk/OpenMPT/soundlib/FileReader.h =================================================================== --- trunk/OpenMPT/soundlib/FileReader.h 2013-01-25 00:01:06 UTC (rev 1508) +++ trunk/OpenMPT/soundlib/FileReader.h 2013-01-30 16:58:33 UTC (rev 1509) @@ -399,9 +399,9 @@ bool ReadVector(std::vector<T> &destVector, size_t destSize) { const off_t readSize = sizeof(T) * destSize; + destVector.resize(destSize); if(CanRead(readSize)) { - destVector.resize(destSize); if(readSize) { memcpy(&destVector[0], streamData + streamPos, readSize); @@ -410,7 +410,6 @@ return true; } else { - destVector.clear(); return false; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-02-02 22:36:29
|
Revision: 1512 http://sourceforge.net/p/modplug/code/1512 Author: saga-games Date: 2013-02-02 22:36:22 +0000 (Sat, 02 Feb 2013) Log Message: ----------- [Imp] Sustain loop preview updating should now be carried out in all cases (http://bugs.openmpt.org/view.php?id=108) [Mod] OpenMPT: Version is now 1.21.01.09 Modified Paths: -------------- trunk/OpenMPT/common/version.h trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_smp.h Modified: trunk/OpenMPT/common/version.h =================================================================== --- trunk/OpenMPT/common/version.h 2013-02-01 23:47:11 UTC (rev 1511) +++ trunk/OpenMPT/common/version.h 2013-02-02 22:36:22 UTC (rev 1512) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 21 #define VER_MINOR 01 -#define VER_MINORMINOR 08 +#define VER_MINORMINOR 09 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2013-02-01 23:47:11 UTC (rev 1511) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2013-02-02 22:36:22 UTC (rev 1512) @@ -955,16 +955,16 @@ void CCtrlSamples::OnSampleNew() //------------------------------ { - const bool bDuplicate = CMainFrame::GetInputHandler()->ShiftPressed(); + const bool duplicate = CMainFrame::GetInputHandler()->ShiftPressed(); SAMPLEINDEX smp = m_pModDoc->InsertSample(true); - if (smp != SAMPLEINDEX_INVALID) + if(smp != SAMPLEINDEX_INVALID) { SAMPLEINDEX nOldSmp = m_nSample; CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); SetCurrentSample(smp); - if(bDuplicate && nOldSmp >= 1 && nOldSmp <= pSndFile->GetNumSamples()) + if(duplicate && nOldSmp >= 1 && nOldSmp <= pSndFile->GetNumSamples()) { m_pModDoc->GetSampleUndo().PrepareUndo(smp, sundo_replace); pSndFile->ReadSampleFromSong(smp, pSndFile, nOldSmp); @@ -2627,20 +2627,12 @@ if ((IsLocked()) || (!m_pSndFile)) return; int n = m_ComboLoopType.GetCurSel(); ModSample &sample = m_pSndFile->GetSample(m_nSample); - bool wasDisabled = (sample.uFlags & CHN_LOOP) == 0; - switch(n) - { - case 0: // Off - sample.uFlags &= ~(CHN_LOOP | CHN_PINGPONGLOOP); - break; - case 1: // On - sample.uFlags &= ~CHN_PINGPONGLOOP; - sample.uFlags |= CHN_LOOP; - break; - case 2: // PingPong - sample.uFlags |= CHN_LOOP | CHN_PINGPONGLOOP; - break; - } + bool wasDisabled = !sample.uFlags[CHN_LOOP]; + + // 0: Off, 1: On, 2: PingPong + sample.uFlags.set(CHN_LOOP, n > 0); + sample.uFlags.set(CHN_PINGPONGLOOP, n == 2); + // set loop points if theren't any if(wasDisabled && ((sample.uFlags & CHN_LOOP) != 0) && (sample.nLoopStart == sample.nLoopEnd) && (sample.nLoopStart == 0)) { @@ -2655,7 +2647,7 @@ } m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); } - m_pModDoc->AdjustEndOfSample(m_nSample); + ctrlSmp::UpdateLoopPoints(sample, *m_pSndFile); m_pModDoc->SetModified(); } @@ -2669,12 +2661,7 @@ if ((n >= 0) && (n < sample.nLength) && ((n < sample.nLoopEnd) || !sample.uFlags[CHN_LOOP])) { sample.nLoopStart = n; - if(sample.uFlags[CHN_LOOP]) - { - // only update sample buffer if the loop is actually enabled - // (resets sound without any reason otherwise) - http://forum.openmpt.org/index.php?topic=1874.0 - m_pModDoc->AdjustEndOfSample(m_nSample); - } + ctrlSmp::UpdateLoopPoints(sample, *m_pSndFile); m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); m_pModDoc->SetModified(); } @@ -2690,12 +2677,7 @@ if ((n >= 0) && (n <= sample.nLength) && ((n > sample.nLoopStart) || !sample.uFlags[CHN_LOOP])) { sample.nLoopEnd = n; - if(sample.uFlags[CHN_LOOP]) - { - // only update sample buffer if the loop is actually enabled - // (resets sound without any reason otherwise) - http://forum.openmpt.org/index.php?topic=1874.0 - m_pModDoc->AdjustEndOfSample(m_nSample); - } + ctrlSmp::UpdateLoopPoints(sample, *m_pSndFile); m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); m_pModDoc->SetModified(); } @@ -2708,20 +2690,13 @@ if ((IsLocked()) || (!m_pSndFile)) return; int n = m_ComboSustainType.GetCurSel(); ModSample &sample = m_pSndFile->GetSample(m_nSample); - bool wasDisabled = (sample.uFlags & CHN_SUSTAINLOOP) == 0; - switch(n) - { - case 0: // Off - sample.uFlags &= ~(CHN_SUSTAINLOOP | CHN_PINGPONGSUSTAIN); - break; - case 1: // On - sample.uFlags &= ~CHN_PINGPONGSUSTAIN; - sample.uFlags |= CHN_SUSTAINLOOP; - break; - case 2: // PingPong - sample.uFlags |= CHN_SUSTAINLOOP | CHN_PINGPONGSUSTAIN; - break; - } + bool wasDisabled = !sample.uFlags[CHN_SUSTAINLOOP]; + + // 0: Off, 1: On, 2: PingPong + sample.uFlags.set(CHN_SUSTAINLOOP, n > 0); + sample.uFlags.set(CHN_PINGPONGSUSTAIN, n == 2); + + // set sustain loop points if theren't any if(wasDisabled && ((sample.uFlags & CHN_SUSTAINLOOP) != 0) && (sample.nSustainStart == sample.nSustainEnd) && (sample.nSustainStart == 0)) { @@ -2736,6 +2711,7 @@ } m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); } + ctrlSmp::UpdateLoopPoints(sample, *m_pSndFile); m_pModDoc->SetModified(); } @@ -2882,6 +2858,7 @@ m_EditLoopStart.SetWindowText(s); m_pModDoc->AdjustEndOfSample(m_nSample); redraw = true; + ctrlSmp::UpdateLoopPoints(sample, *m_pSndFile); } m_SpinLoopStart.SetPos(0); } @@ -2926,6 +2903,7 @@ m_EditLoopEnd.SetWindowText(s); m_pModDoc->AdjustEndOfSample(m_nSample); redraw = true; + ctrlSmp::UpdateLoopPoints(sample, *m_pSndFile); } m_SpinLoopEnd.SetPos(0); } @@ -2970,6 +2948,7 @@ wsprintf(s, "%u", sample.nSustainStart); m_EditSustainStart.SetWindowText(s); redraw = true; + ctrlSmp::UpdateLoopPoints(sample, *m_pSndFile); } m_SpinSustainStart.SetPos(0); } @@ -3013,6 +2992,7 @@ wsprintf(s, "%u", sample.nSustainEnd); m_EditSustainEnd.SetWindowText(s); redraw = true; + ctrlSmp::UpdateLoopPoints(sample, *m_pSndFile); } m_SpinSustainEnd.SetPos(0); } Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2013-02-01 23:47:11 UTC (rev 1511) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2013-02-02 22:36:22 UTC (rev 1512) @@ -77,8 +77,6 @@ ON_WM_NCLBUTTONDBLCLK() ON_WM_RBUTTONDOWN() ON_WM_CHAR() - ON_WM_KEYDOWN() - ON_WM_KEYUP() ON_WM_DROPFILES() ON_WM_MOUSEWHEEL() ON_COMMAND(ID_EDIT_UNDO, OnEditUndo) @@ -108,7 +106,7 @@ ON_COMMAND(ID_SAMPLE_GRID, OnChangeGridSize) ON_COMMAND(ID_SAMPLE_QUICKFADE, OnQuickFade) ON_MESSAGE(WM_MOD_MIDIMSG, OnMidiMsg) - ON_MESSAGE(WM_MOD_KEYCOMMAND, OnCustomKeyMsg) //rewbs.customKeys + ON_MESSAGE(WM_MOD_KEYCOMMAND, OnCustomKeyMsg) //rewbs.customKeys //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -256,8 +254,8 @@ } -void CViewSample::SetCurSel(DWORD nBegin, DWORD nEnd) -//--------------------------------------------------- +void CViewSample::SetCurSel(SmpLength nBegin, SmpLength nEnd) +//----------------------------------------------------------- { CSoundFile *pSndFile = (GetDocument()) ? GetDocument()->GetSoundFile() : nullptr; if(pSndFile == nullptr) @@ -267,8 +265,8 @@ if(m_nGridSegments > 0) { const float sampsPerSegment = (float)(pSndFile->GetSample(m_nSample).nLength / m_nGridSegments); - nBegin = (DWORD)(floor((float)(nBegin / sampsPerSegment) + 0.5f) * sampsPerSegment); - nEnd = (DWORD)(floor((float)(nEnd / sampsPerSegment) + 0.5f) * sampsPerSegment); + nBegin = (SmpLength)(floor((float)(nBegin / sampsPerSegment) + 0.5f) * sampsPerSegment); + nEnd = (SmpLength)(floor((float)(nEnd / sampsPerSegment) + 0.5f) * sampsPerSegment); } if (nBegin > nEnd) @@ -279,7 +277,7 @@ if ((nBegin != m_dwBeginSel) || (nEnd != m_dwEndSel)) { RECT rect; - DWORD dMin = m_dwBeginSel, dMax = m_dwEndSel; + SmpLength dMin = m_dwBeginSel, dMax = m_dwEndSel; if (m_dwBeginSel >= m_dwEndSel) { dMin = nBegin; @@ -317,10 +315,10 @@ s[0] = 0; if (m_dwEndSel > m_dwBeginSel) { - const DWORD selLength = m_dwEndSel - m_dwBeginSel; + const SmpLength selLength = m_dwEndSel - m_dwBeginSel; wsprintf(s, "[%d,%d] (%d sample%s, ", m_dwBeginSel, m_dwEndSel, selLength, (selLength == 1) ? "" : "s"); - LONG lSampleRate = pSndFile->GetSample(m_nSample).nC5Speed; - if (pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) + uint32 lSampleRate = pSndFile->GetSample(m_nSample).nC5Speed; + if (pSndFile->GetType() & (MOD_TYPE_MOD|MOD_TYPE_XM)) { lSampleRate = ModSample::TransposeToFrequency(pSndFile->GetSample(m_nSample).RelativeTone, pSndFile->GetSample(m_nSample).nFineTune); } @@ -2235,7 +2233,7 @@ else pModDoc->NoteOff(0, true); - DWORD loopstart = m_dwBeginSel, loopend = m_dwEndSel; + SmpLength loopstart = m_dwBeginSel, loopend = m_dwEndSel; if (loopend - loopstart < (UINT)(4 << m_nZoom)) loopend = loopstart = 0; // selection is too small -> no loop @@ -2243,13 +2241,13 @@ m_dwStatus |= SMPSTATUS_KEYDOWN; s[0] = 0; - if(ModCommand::IsNote(note)) + if(ModCommand::IsNote((ModCommand::NOTE)note)) { CSoundFile *pSndFile = pModDoc->GetSoundFile(); ModSample &sample = pSndFile->GetSample(m_nSample); uint32 freq = pSndFile->GetFreqFromPeriod(pSndFile->GetPeriodFromNote(note + (pSndFile->GetType() == MOD_TYPE_XM ? sample.RelativeTone : 0), sample.nFineTune, sample.nC5Speed), sample.nC5Speed, 0); - wsprintf(s, "%s%d (%d Hz)", szNoteNames[(note - 1) % 12], (note - 1) / 12, freq); + wsprintf(s, "%s (%d Hz)", szDefaultNoteNames[note - 1], freq); } pMainFrm->SetInfoText(s); } @@ -2258,32 +2256,6 @@ } -void CViewSample::OnKeyDown(UINT /*nChar*/, UINT /*nRepCnt*/, UINT /*nFlags*/) -//---------------------------------------------------------------- -{ - /* - switch(nChar) - { - case VK_DELETE: - OnEditDelete(); - break; - default: - CModScrollView::OnKeyDown(nChar, nRepCnt, nFlags); - } - */ -} - - -void CViewSample::OnKeyUp(UINT /*nChar*/, UINT /*nRepCnt*/, UINT /*nFlags*/) -//-------------------------------------------------------------- -{ - /* - m_dwStatus &= ~SMPSTATUS_KEYDOWN; - CModScrollView::OnKeyUp(nChar, nRepCnt, nFlags); - */ -} - - void CViewSample::OnDropFiles(HDROP hDropInfo) //-------------------------------------------- { @@ -2492,7 +2464,7 @@ sample.nLoopStart = m_dwMenuParam; sample.uFlags |= CHN_LOOP; pModDoc->SetModified(); - pModDoc->AdjustEndOfSample(m_nSample); + ctrlSmp::UpdateLoopPoints(sample, *pSndFile); pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL); } } @@ -2513,7 +2485,7 @@ sample.nLoopEnd = m_dwMenuParam; sample.uFlags |= CHN_LOOP; pModDoc->SetModified(); - pModDoc->AdjustEndOfSample(m_nSample); + ctrlSmp::UpdateLoopPoints(sample, *pSndFile); pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL); } } @@ -2534,7 +2506,7 @@ sample.nSustainStart = m_dwMenuParam; sample.uFlags |= CHN_SUSTAINLOOP; pModDoc->SetModified(); - pModDoc->AdjustEndOfSample(m_nSample); + ctrlSmp::UpdateLoopPoints(sample, *pSndFile); pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL); } } @@ -2555,7 +2527,7 @@ sample.nSustainEnd = m_dwMenuParam; sample.uFlags |= CHN_SUSTAINLOOP; pModDoc->SetModified(); - pModDoc->AdjustEndOfSample(m_nSample); + ctrlSmp::UpdateLoopPoints(sample, *pSndFile); pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA, NULL); } } Modified: trunk/OpenMPT/mptrack/View_smp.h =================================================================== --- trunk/OpenMPT/mptrack/View_smp.h 2013-02-01 23:47:11 UTC (rev 1511) +++ trunk/OpenMPT/mptrack/View_smp.h 2013-02-02 22:36:22 UTC (rev 1512) @@ -29,7 +29,8 @@ SIZE m_sizeTotal; SAMPLEINDEX m_nSample; UINT m_nZoom, m_nScrollPos, m_nScrollFactor, m_nBtnMouseOver; - DWORD m_dwStatus, m_dwBeginSel, m_dwEndSel, m_dwBeginDrag, m_dwEndDrag; + DWORD m_dwStatus; + SmpLength m_dwBeginSel, m_dwEndSel, m_dwBeginDrag, m_dwEndDrag; DWORD m_dwMenuParam; DWORD m_NcButtonState[SMP_LEFTBAR_BUTTONS]; DWORD m_dwNotifyPos[MAX_CHANNELS]; @@ -51,7 +52,7 @@ DWORD ScreenToSample(LONG x) const; void PlayNote(UINT note, const uint32 nStartPos = 0); //rewbs.customKeys void InvalidateSample(); - void SetCurSel(DWORD nBegin, DWORD nEnd); + void SetCurSel(SmpLength nBegin, SmpLength nEnd); void ScrollToPosition(int x); void DrawPositionMarks(HDC hdc); void DrawSampleData1(HDC hdc, int ymed, int cx, int cy, int len, int uFlags, PVOID pSampleData); @@ -113,8 +114,6 @@ #endif afx_msg void OnNcPaint(); afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); - afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); - afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point); afx_msg void OnNcLButtonDown(UINT, CPoint); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |