From: <sag...@us...> - 2015-05-31 17:22:45
|
Revision: 5217 http://sourceforge.net/p/modplug/code/5217 Author: saga-games Date: 2015-05-31 17:22:30 +0000 (Sun, 31 May 2015) Log Message: ----------- [New] Support for fractional tempo in the MPTM format. At the moment, only the default tempo can be fractional, Txx still only supports integer tempos (http://bugs.openmpt.org/view.php?id=145). [New] Support for fractional tempo for pitch/tempo lock. [Ref] Since most of the related files had to be touched anyway, rename a few enums: enmEnvelopeTypes => EnvelopeType, tempoMode => TempoMode, mixLevels => MixLevels, forcePanningMode => ForcePanningMode [Mod] OpenMPT: Version is now 1.25.00.10 Modified Paths: -------------- trunk/OpenMPT/build/vs2008/OpenMPT.vcproj trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/AppendModule.cpp trunk/OpenMPT/mptrack/AutoSaver.cpp trunk/OpenMPT/mptrack/Childfrm.h trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Ctrl_com.cpp trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_gen.h trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_ins.h trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/EffectInfo.cpp trunk/OpenMPT/mptrack/ExceptionHandler.cpp trunk/OpenMPT/mptrack/Globals.cpp trunk/OpenMPT/mptrack/KeyConfigDlg.cpp trunk/OpenMPT/mptrack/MIDIMappingDialog.cpp trunk/OpenMPT/mptrack/MPTHacks.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h trunk/OpenMPT/mptrack/ModConvert.cpp trunk/OpenMPT/mptrack/ModConvert.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/PSRatioCalc.cpp trunk/OpenMPT/mptrack/PSRatioCalc.h trunk/OpenMPT/mptrack/PatternClipboard.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_ins.h trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/mptrack/mod2midi.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters trunk/OpenMPT/mptrack/view_com.cpp trunk/OpenMPT/soundlib/Fastmix.cpp trunk/OpenMPT/soundlib/InstrumentExtensions.cpp trunk/OpenMPT/soundlib/Load_669.cpp trunk/OpenMPT/soundlib/Load_amf.cpp trunk/OpenMPT/soundlib/Load_ams.cpp trunk/OpenMPT/soundlib/Load_dbm.cpp trunk/OpenMPT/soundlib/Load_dmf.cpp trunk/OpenMPT/soundlib/Load_dsm.cpp trunk/OpenMPT/soundlib/Load_far.cpp trunk/OpenMPT/soundlib/Load_gdm.cpp trunk/OpenMPT/soundlib/Load_imf.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_itp.cpp trunk/OpenMPT/soundlib/Load_mdl.cpp trunk/OpenMPT/soundlib/Load_med.cpp trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_mt2.cpp trunk/OpenMPT/soundlib/Load_okt.cpp trunk/OpenMPT/soundlib/Load_plm.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Load_stm.cpp trunk/OpenMPT/soundlib/Load_wav.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/ModChannel.h trunk/OpenMPT/soundlib/ModInstrument.cpp trunk/OpenMPT/soundlib/ModInstrument.h trunk/OpenMPT/soundlib/ModSequence.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/SoundFilePlayConfig.cpp trunk/OpenMPT/soundlib/SoundFilePlayConfig.h trunk/OpenMPT/soundlib/UpgradeModule.cpp trunk/OpenMPT/soundlib/load_j2b.cpp trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/mod_specifications.h trunk/OpenMPT/soundlib/modcommand.cpp trunk/OpenMPT/soundlib/pattern.cpp trunk/OpenMPT/soundlib/patternContainer.cpp trunk/OpenMPT/test/test.cpp trunk/OpenMPT/test/test.mptm Added Paths: ----------- trunk/OpenMPT/mptrack/CDecimalSupport.cpp trunk/OpenMPT/mptrack/CDecimalSupport.h Modified: trunk/OpenMPT/build/vs2008/OpenMPT.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/OpenMPT.vcproj 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/build/vs2008/OpenMPT.vcproj 2015-05-31 17:22:30 UTC (rev 5217) @@ -832,6 +832,14 @@ > </File> <File + RelativePath="..\..\mptrack\CDecimalSupport.cpp" + > + </File> + <File + RelativePath="..\..\mptrack\CDecimalSupport.h" + > + </File> + <File RelativePath="..\..\mptrack\CImageListEx.cpp" > </File> Modified: trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj 2015-05-31 17:22:30 UTC (rev 5217) @@ -376,6 +376,7 @@ <ClInclude Include="..\..\mptrack\AdvancedConfigDlg.h" /> <ClInclude Include="..\..\mptrack\AutoSaver.h" /> <ClInclude Include="..\..\mptrack\Autotune.h" /> + <ClInclude Include="..\..\mptrack\CDecimalSupport.h" /> <ClInclude Include="..\..\mptrack\CImageListEx.h" /> <ClInclude Include="..\..\mptrack\CListCtrl.h" /> <ClInclude Include="..\..\mptrack\CTreeCtrl.h" /> @@ -556,6 +557,7 @@ <ClCompile Include="..\..\mptrack\AppendModule.cpp" /> <ClCompile Include="..\..\mptrack\AutoSaver.cpp" /> <ClCompile Include="..\..\mptrack\Autotune.cpp" /> + <ClCompile Include="..\..\mptrack\CDecimalSupport.cpp" /> <ClCompile Include="..\..\mptrack\CImageListEx.cpp" /> <ClCompile Include="..\..\mptrack\ChannelManagerDlg.cpp" /> <ClCompile Include="..\..\mptrack\Childfrm.cpp" /> Modified: trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters 2015-05-31 17:22:30 UTC (rev 5217) @@ -125,6 +125,9 @@ <ClInclude Include="..\..\mptrack\Autotune.h"> <Filter>mptrack</Filter> </ClInclude> + <ClInclude Include="..\..\mptrack\CDecimalSupport.h"> + <Filter>mptrack</Filter> + </ClInclude> <ClInclude Include="..\..\mptrack\CImageListEx.h"> <Filter>mptrack</Filter> </ClInclude> @@ -640,6 +643,9 @@ <ClCompile Include="..\..\mptrack\Autotune.cpp"> <Filter>mptrack</Filter> </ClCompile> + <ClCompile Include="..\..\mptrack\CDecimalSupport.cpp"> + <Filter>mptrack</Filter> + </ClCompile> <ClCompile Include="..\..\mptrack\CImageListEx.cpp"> <Filter>mptrack</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj 2015-05-31 17:22:30 UTC (rev 5217) @@ -382,6 +382,7 @@ <ClInclude Include="..\..\mptrack\AdvancedConfigDlg.h" /> <ClInclude Include="..\..\mptrack\AutoSaver.h" /> <ClInclude Include="..\..\mptrack\Autotune.h" /> + <ClInclude Include="..\..\mptrack\CDecimalSupport.h" /> <ClInclude Include="..\..\mptrack\CImageListEx.h" /> <ClInclude Include="..\..\mptrack\CListCtrl.h" /> <ClInclude Include="..\..\mptrack\CTreeCtrl.h" /> @@ -562,6 +563,7 @@ <ClCompile Include="..\..\mptrack\AppendModule.cpp" /> <ClCompile Include="..\..\mptrack\AutoSaver.cpp" /> <ClCompile Include="..\..\mptrack\Autotune.cpp" /> + <ClCompile Include="..\..\mptrack\CDecimalSupport.cpp" /> <ClCompile Include="..\..\mptrack\CImageListEx.cpp" /> <ClCompile Include="..\..\mptrack\ChannelManagerDlg.cpp" /> <ClCompile Include="..\..\mptrack\Childfrm.cpp" /> Modified: trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters 2015-05-31 17:22:30 UTC (rev 5217) @@ -125,6 +125,9 @@ <ClInclude Include="..\..\mptrack\Autotune.h"> <Filter>mptrack</Filter> </ClInclude> + <ClInclude Include="..\..\mptrack\CDecimalSupport.h"> + <Filter>mptrack</Filter> + </ClInclude> <ClInclude Include="..\..\mptrack\CImageListEx.h"> <Filter>mptrack</Filter> </ClInclude> @@ -640,6 +643,9 @@ <ClCompile Include="..\..\mptrack\Autotune.cpp"> <Filter>mptrack</Filter> </ClCompile> + <ClCompile Include="..\..\mptrack\CDecimalSupport.cpp"> + <Filter>mptrack</Filter> + </ClCompile> <ClCompile Include="..\..\mptrack\CImageListEx.cpp"> <Filter>mptrack</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj 2015-05-31 17:22:30 UTC (rev 5217) @@ -383,6 +383,7 @@ <ClInclude Include="..\..\mptrack\AdvancedConfigDlg.h" /> <ClInclude Include="..\..\mptrack\AutoSaver.h" /> <ClInclude Include="..\..\mptrack\Autotune.h" /> + <ClInclude Include="..\..\mptrack\CDecimalSupport.h" /> <ClInclude Include="..\..\mptrack\CImageListEx.h" /> <ClInclude Include="..\..\mptrack\CListCtrl.h" /> <ClInclude Include="..\..\mptrack\CTreeCtrl.h" /> @@ -563,6 +564,7 @@ <ClCompile Include="..\..\mptrack\AppendModule.cpp" /> <ClCompile Include="..\..\mptrack\AutoSaver.cpp" /> <ClCompile Include="..\..\mptrack\Autotune.cpp" /> + <ClCompile Include="..\..\mptrack\CDecimalSupport.cpp" /> <ClCompile Include="..\..\mptrack\CImageListEx.cpp" /> <ClCompile Include="..\..\mptrack\ChannelManagerDlg.cpp" /> <ClCompile Include="..\..\mptrack\Childfrm.cpp" /> Modified: trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters 2015-05-31 17:22:30 UTC (rev 5217) @@ -125,6 +125,9 @@ <ClInclude Include="..\..\mptrack\Autotune.h"> <Filter>mptrack</Filter> </ClInclude> + <ClInclude Include="..\..\mptrack\CDecimalSupport.h"> + <Filter>mptrack</Filter> + </ClInclude> <ClInclude Include="..\..\mptrack\CImageListEx.h"> <Filter>mptrack</Filter> </ClInclude> @@ -640,6 +643,9 @@ <ClCompile Include="..\..\mptrack\Autotune.cpp"> <Filter>mptrack</Filter> </ClCompile> + <ClCompile Include="..\..\mptrack\CDecimalSupport.cpp"> + <Filter>mptrack</Filter> + </ClCompile> <ClCompile Include="..\..\mptrack\CImageListEx.cpp"> <Filter>mptrack</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj 2015-05-31 17:22:30 UTC (rev 5217) @@ -383,6 +383,7 @@ <ClInclude Include="..\..\mptrack\AdvancedConfigDlg.h" /> <ClInclude Include="..\..\mptrack\AutoSaver.h" /> <ClInclude Include="..\..\mptrack\Autotune.h" /> + <ClInclude Include="..\..\mptrack\CDecimalSupport.h" /> <ClInclude Include="..\..\mptrack\CImageListEx.h" /> <ClInclude Include="..\..\mptrack\CListCtrl.h" /> <ClInclude Include="..\..\mptrack\CTreeCtrl.h" /> @@ -563,6 +564,7 @@ <ClCompile Include="..\..\mptrack\AppendModule.cpp" /> <ClCompile Include="..\..\mptrack\AutoSaver.cpp" /> <ClCompile Include="..\..\mptrack\Autotune.cpp" /> + <ClCompile Include="..\..\mptrack\CDecimalSupport.cpp" /> <ClCompile Include="..\..\mptrack\CImageListEx.cpp" /> <ClCompile Include="..\..\mptrack\ChannelManagerDlg.cpp" /> <ClCompile Include="..\..\mptrack\Childfrm.cpp" /> Modified: trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters 2015-05-31 17:22:30 UTC (rev 5217) @@ -125,6 +125,9 @@ <ClInclude Include="..\..\mptrack\Autotune.h"> <Filter>mptrack</Filter> </ClInclude> + <ClInclude Include="..\..\mptrack\CDecimalSupport.h"> + <Filter>mptrack</Filter> + </ClInclude> <ClInclude Include="..\..\mptrack\CImageListEx.h"> <Filter>mptrack</Filter> </ClInclude> @@ -640,6 +643,9 @@ <ClCompile Include="..\..\mptrack\Autotune.cpp"> <Filter>mptrack</Filter> </ClCompile> + <ClCompile Include="..\..\mptrack\CDecimalSupport.cpp"> + <Filter>mptrack</Filter> + </ClCompile> <ClCompile Include="..\..\mptrack\CImageListEx.cpp"> <Filter>mptrack</Filter> </ClCompile> Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/common/versionNumber.h 2015-05-31 17:22:30 UTC (rev 5217) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 25 #define VER_MINOR 00 -#define VER_MINORMINOR 09 +#define VER_MINORMINOR 10 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -29,6 +29,7 @@ #include "common/misc_util.h" #include "common/FileReader.h" #include "soundlib/Sndfile.h" +#include "soundlib/mod_specifications.h" #include "soundlib/AudioReadTarget.h" using namespace OpenMPT; Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -13,6 +13,7 @@ #include "Moddoc.h" #include "Mainfrm.h" #include "../soundlib/Sndfile.h" +#include "../soundlib/mod_specifications.h" #include "Vstplug.h" #include "dlg_misc.h" #include "AbstractVstEditor.h" Modified: trunk/OpenMPT/mptrack/AppendModule.cpp =================================================================== --- trunk/OpenMPT/mptrack/AppendModule.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/AppendModule.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -10,6 +10,7 @@ #include "stdafx.h" #include "Moddoc.h" +#include "../soundlib/mod_specifications.h" OPENMPT_NAMESPACE_BEGIN Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -14,6 +14,7 @@ #include "Moddoc.h" #include "AutoSaver.h" #include "FileDialog.h" +#include "../soundlib/mod_specifications.h" #include <algorithm> Added: trunk/OpenMPT/mptrack/CDecimalSupport.cpp =================================================================== --- trunk/OpenMPT/mptrack/CDecimalSupport.cpp (rev 0) +++ trunk/OpenMPT/mptrack/CDecimalSupport.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -0,0 +1,46 @@ +/* + * CDecimalSupport.cpp + * ------------------- + * Purpose: Various extensions of the CDecimalSupport implementation. + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#include "stdafx.h" +#include "Snd_defs.h" +#include "CDecimalSupport.h" + +OPENMPT_NAMESPACE_BEGIN + +BEGIN_MESSAGE_MAP(CNumberEdit, CEdit) + ON_WM_CHAR() +END_MESSAGE_MAP() + + +void CNumberEdit::SetTempoValue(const TEMPO &t) +//--------------------------------------------- +{ + SetFixedValue(t.ToDouble(), 4); +} + + +TEMPO CNumberEdit::GetTempoValue() +//-------------------------------- +{ + double d; + GetDecimalValue(d); + return TEMPO(d); +} + + +void CNumberEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) +//------------------------------------------------------------- +{ + BOOL bHandled = false; + CDecimalSupport<CNumberEdit>::OnChar(0, nChar, 0, bHandled); + if(!bHandled) CEdit::OnChar(nChar , nRepCnt, nFlags); +} + +OPENMPT_NAMESPACE_END \ No newline at end of file Property changes on: trunk/OpenMPT/mptrack/CDecimalSupport.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/mptrack/CDecimalSupport.h =================================================================== --- trunk/OpenMPT/mptrack/CDecimalSupport.h (rev 0) +++ trunk/OpenMPT/mptrack/CDecimalSupport.h 2015-05-31 17:22:30 UTC (rev 5217) @@ -0,0 +1,387 @@ +/* + * CDecimalSupport.h + * ----------------- + * Purpose: Edit field which allows negative and fractional values to be entered + * Notes : Alexander Uckun's original code has beem modified a bit to suit our purposes. + * Authors: OpenMPT Devs + * Alexander Uckun + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#pragma once + +OPENMPT_NAMESPACE_BEGIN + +/////////////////////////////////////////////////////////////////////////////// +/// \class CDecimalSupport +/// \brief decimal number support for your control +/// \author Alexander Uckun +/// \version 1.0 + +// Copyright (c) 2007 - Alexander Uckun +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +template <class T, size_t limit = _CVTBUFSIZE> +class CDecimalSupport +{ + /// the locale dependant decimal separator + TCHAR m_DecimalSeparator[5]; + /// the locale dependant negative sign + TCHAR m_NegativeSign[6]; + + bool allowSign, allowFractions; + +public: + +#ifdef BEGIN_MSG_MAP + BEGIN_MSG_MAP(CDecimalSupport) + + ALT_MSG_MAP(8) + MESSAGE_HANDLER(WM_CHAR, OnChar) + MESSAGE_HANDLER(WM_PASTE, OnPaste) + END_MSG_MAP() +#endif + + /// \brief Initialize m_DecimalSeparator and m_NegativeSign + /// \remarks calls InitDecimalSeparator and InitNegativeSign + CDecimalSupport() + : allowSign(true) + , allowFractions(true) + { + InitDecimalSeparator(); + InitNegativeSign(); + } + + /// \brief sets m_DecimalSeparator + /// \remarks calls GetLocaleInfo with LOCALE_SDECIMAL to set m_DecimalSeparator + /// \param[in] Locale the locale parameter (see GetLocaleInfo) + /// \return the number of TCHARs written to the destination buffer + int InitDecimalSeparator(LCID Locale = LOCALE_USER_DEFAULT) + { + return ::GetLocaleInfo( Locale, LOCALE_SDECIMAL, m_DecimalSeparator , sizeof(m_DecimalSeparator) / sizeof(TCHAR)); + } + + /// \brief sets m_NegativeSign + /// \remarks calls GetLocaleInfo with LOCALE_SNEGATIVESIGN to set m_NegativeSign + /// \param[in] Locale the locale parameter (see GetLocaleInfo) + /// \return the number of TCHARs written to the destination buffer + int InitNegativeSign(LCID Locale = LOCALE_USER_DEFAULT) + { + return ::GetLocaleInfo( Locale, LOCALE_SNEGATIVESIGN, m_NegativeSign , sizeof(m_NegativeSign) / sizeof(TCHAR)); + } + + /// callback for the WM_PASTE message + /// validates the input + /// \param uMsg + /// \param wParam + /// \param lParam + /// \param[out] bHandled true, if the text is a valid number + /// \return 0 + LRESULT OnPaste(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/,BOOL& bHandled) + { + bHandled = false; + int neg_sign = 0; + int dec_point = 0; + + T* pT = static_cast<T*>(this); + int nStartChar; + int nEndChar; + pT->GetSel(nStartChar , nEndChar); + TCHAR buffer[limit]; + pT->GetWindowText(buffer, limit); + + // Check if the texr already contains a decimal point + for (TCHAR* x = buffer; *x; ++x) + { + if (x - buffer == nStartChar) x += nEndChar - nStartChar; + if (*x == m_DecimalSeparator[0]) ++dec_point; + if (*x == m_NegativeSign[0]) ++neg_sign; + } + +#ifdef _UNICODE + if (!IsClipboardFormatAvailable(CF_UNICODETEXT)) return 0; +#else + if (!IsClipboardFormatAvailable(CF_TEXT)) return 0; +#endif + + if (!OpenClipboard((HWND) *pT)) return 0; + +#ifdef _UNICODE + HGLOBAL hglb = GetClipboardData(CF_UNICODETEXT); +#else + HGLOBAL hglb = ::GetClipboardData(CF_TEXT); +#endif + if (hglb != NULL) + { + LPTSTR lptstr = reinterpret_cast<TCHAR*>(GlobalLock(hglb)); + if (lptstr != NULL) + { + for (TCHAR* s = lptstr; *s; ++s) + { + if (*s == m_NegativeSign[0]) + { + + for (TCHAR* t = m_NegativeSign + 1; *t; ++t, ++s) + { + if (*t != *(s+1)) ++neg_sign; + } + + if (neg_sign || nStartChar > 0) + { + bHandled = true; + break; + } + + ++neg_sign; + continue; + } + if (*s == m_DecimalSeparator[0]) + { + for (TCHAR* t = m_DecimalSeparator + 1; *t ; ++t, ++s) + { + if (*t != *(s+1)) ++dec_point; + } + + if (dec_point) + { + bHandled = true; + break; + } + ++dec_point; + continue; + } + + if (*s < _T('0') || *s > _T('9')) + { + bHandled = true; + break; + } + + } + + GlobalUnlock(hglb); + + } + } + CloseClipboard(); + return 0; + } + + + /// callback for the WM_CHAR message + /// handles the decimal point and the negative sign keys + /// \param uMsg + /// \param[in] wParam contains the pressed key + /// \param lParam + /// \param[out] bHandled true, if the key press was handled in this function + /// \return 0 + LRESULT OnChar(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& bHandled) + { + bHandled = false; + if (static_cast<TCHAR>(wParam) == m_DecimalSeparator[0] || wParam == _T('.') && allowFractions) + { + T* pT = static_cast<T*>(this); + int nStartChar; + int nEndChar; + pT->GetSel(nStartChar , nEndChar); + TCHAR buffer[limit]; + pT->GetWindowText(buffer, limit); + //Verify that the control doesn't already contain a decimal point + for (TCHAR* x = buffer; *x; ++x) + { + if (x - buffer == nStartChar) x += nEndChar - nStartChar; + if (*x == m_DecimalSeparator[0]) return 0; + } + + pT->ReplaceSel(m_DecimalSeparator, true); + bHandled = true; + } + + if (static_cast<TCHAR>(wParam) == m_NegativeSign[0] && allowSign) + { + T* pT = static_cast<T*>(this); + int nStartChar; + int nEndChar; + pT->GetSel(nStartChar , nEndChar); + if (nStartChar) return 0; + + TCHAR buffer[limit]; + pT->GetWindowText(buffer, limit); + //Verify that the control doesn't already contain a negative sign + if (nEndChar == 0 && buffer[0] == m_NegativeSign[0]) return 0; + pT->ReplaceSel(m_NegativeSign, true); + bHandled = true; + } + return 0; + } + + /// converts the controls text to double + /// \param[out] d the converted value + /// \return true on success + bool GetDecimalValue(double& d) const + { + TCHAR szBuff[limit]; + static_cast<const T*>(this)->GetWindowText(szBuff, limit); + return TextToDouble(szBuff, d); + } + + /// converts a string to double + /// \remarks the decimal separator and the negative sign may change in the string + /// \param[in, out] szBuff the string to convert + /// \param[out] d the converted value + /// \return true on success + bool TextToDouble(TCHAR* szBuff, double& d) const + { + //replace the locale dependant separator with . + if (m_DecimalSeparator[0] != _T('.')) + { + for (TCHAR* x = szBuff; *x; ++x) + { + if (*x == m_DecimalSeparator[0]) + { + *x = _T('.'); + break; + } + } + + } + + TCHAR* endPtr; + //replace the negative sign with - + if (szBuff[0] == m_NegativeSign[0]) szBuff[0] = _T('-'); + d = _tcstod(szBuff, &endPtr); + return *endPtr == _T('\0'); + } + + /// sets a number as the controls text + /// \param[in] d the value + /// \param[in] count digits after the decimal point + void SetFixedValue(double d, int count) + { + int decimal_pos; + int sign; +#if _MSC_VER >= 1400 + char digits[limit]; + _fcvt_s(digits,d,count,&decimal_pos,&sign); +#else + char* digits = _fcvt(d,count,&decimal_pos,&sign); +#endif + return DisplayDecimalValue(digits, decimal_pos, sign); + } + + /// sets a number as the controls text + /// \param[in] d the value + /// \param[in] count total number of digits + + void SetDecimalValue(double d, int count) + { + int decimal_pos; + int sign; +#if _MSC_VER >= 1400 + char digits[limit]; + _ecvt_s(digits,d,count,&decimal_pos,&sign); +#else + char* digits = _ecvt(d,count,&decimal_pos,&sign); +#endif + DisplayDecimalValue(digits, decimal_pos, sign); + } + /// sets a number as the controls text + /// \param[in] d the value + /// \remarks the total number of digits is calculated using the GetLimitText function + + void SetDecimalValue(double d) + { + SetDecimalValue(d , std::min(limit , static_cast<const T*>(this)->GetLimitText()) - 2); + } + + /// sets the controls text + /// \param[in] digits array containing the digits + /// \param[in] decimal_pos the position of the decimal point + /// \param[in] sign 1 if negative + + void DisplayDecimalValue(const char* digits, int decimal_pos, int sign) + { + TCHAR szBuff[limit]; + DecimalToText(szBuff, limit , digits, decimal_pos, sign); + static_cast<T*>(this)->SetWindowText(szBuff); + } + + /// convert a digit array to string + /// \param[out] szBuff target buffer for output + /// \param[in] buflen maximum characters in output buffer + /// \param[in] digits array containing the digits + /// \param[in] decimal_pos the position of the decimal point + /// \param[in] sign 1 if negative + + void DecimalToText(TCHAR* szBuff, size_t buflen , const char* digits, int decimal_pos, int sign) const + { + int i = 0; + size_t pos = 0; + if (sign) + { + for (const TCHAR *x = m_NegativeSign; *x ; ++x , ++pos) szBuff[pos] = *x; + } + + for (; pos < buflen && digits[i] && i < decimal_pos ; ++i , ++pos) szBuff[pos] = digits[i]; + + if (decimal_pos < 1) szBuff[pos++] = _T('0'); + size_t last_nonzero = pos; + + for (const TCHAR *x = m_DecimalSeparator; *x ; ++x , ++pos) szBuff[pos] = *x; + for (; pos < buflen && decimal_pos < 0; ++decimal_pos , ++pos) szBuff[pos] = _T('0'); + + for (; pos < buflen && digits[i]; ++i , ++pos) + { + szBuff[pos] = digits[i]; + if (digits[i] != '0') last_nonzero = pos+1; + } + szBuff[std::min(buflen - 1,last_nonzero)] = _T('\0'); + } + + void AllowSign(bool allow) + { + allowSign = allow; + } + + void AllowFractions(bool allow) + { + allowFractions = allow; + } + +}; + + +class CNumberEdit : public CEdit, public CDecimalSupport<CNumberEdit> +{ +public: + void SetTempoValue(const TEMPO &t); + TEMPO GetTempoValue(); + +protected: + afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags); + DECLARE_MESSAGE_MAP() +}; + +OPENMPT_NAMESPACE_END \ No newline at end of file Property changes on: trunk/OpenMPT/mptrack/CDecimalSupport.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-chdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/OpenMPT/mptrack/Childfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Childfrm.h 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/Childfrm.h 2015-05-31 17:22:30 UTC (rev 5217) @@ -52,7 +52,7 @@ typedef struct INSTRUMENTVIEWSTATE { DWORD cbStruct; - enmEnvelopeTypes nEnv; + EnvelopeType nEnv; INSTRUMENTINDEX initialInstrument; bool bGrid; } INSTRUMENTVIEWSTATE; Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -812,13 +812,13 @@ // convert to IT... modDoc.ChangeModType(MOD_TYPE_IT); - sndFile.SetMixLevels(mixLevels_compatible); - sndFile.m_nTempoMode = tempo_mode_classic; + sndFile.SetMixLevels(mixLevelsCompatible); + sndFile.m_nTempoMode = tempoModeClassic; sndFile.m_SongFlags = SONG_LINEARSLIDES; sndFile.m_MidiCfg.Reset(); // Global vars - sndFile.m_nDefaultTempo = 125; + sndFile.m_nDefaultTempo.Set(125); sndFile.m_nDefaultSpeed = 6; sndFile.m_nDefaultGlobalVolume = MAX_GLOBAL_VOLUME; sndFile.m_nSamplePreAmp = 48; Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/Ctrl_com.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -10,13 +10,14 @@ #include "stdafx.h" -#include "mptrack.h" -#include "mainfrm.h" -#include "moddoc.h" -#include "globals.h" -#include "ctrl_com.h" +#include "Mptrack.h" +#include "Mainfrm.h" +#include "Moddoc.h" +#include "Globals.h" +#include "Ctrl_com.h" #include "view_com.h" #include "InputHandler.h" +#include "../soundlib/mod_specifications.h" OPENMPT_NAMESPACE_BEGIN Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -1,5 +1,5 @@ /* - * ctrl_gen.cpp + * Ctrl_gen.cpp * ------------ * Purpose: General tab, upper panel. * Notes : (currently none) @@ -10,15 +10,15 @@ #include "stdafx.h" -#include "mptrack.h" -#include "mainfrm.h" -#include "moddoc.h" -#include "globals.h" +#include "Mptrack.h" +#include "Mainfrm.h" +#include "Moddoc.h" +#include "Globals.h" #include "dlg_misc.h" -#include "ctrl_gen.h" -#include "view_gen.h" -#include "math.h" +#include "Ctrl_gen.h" +#include "View_gen.h" #include "../common/misc_util.h" +#include "../soundlib/mod_specifications.h" OPENMPT_NAMESPACE_BEGIN @@ -51,7 +51,7 @@ //{{AFX_DATA_MAP(CCtrlGeneral) DDX_Control(pDX, IDC_EDIT_SONGTITLE, m_EditTitle); DDX_Control(pDX, IDC_EDIT_ARTIST, m_EditArtist); - DDX_Control(pDX, IDC_EDIT_TEMPO, m_EditTempo); + //DDX_Control(pDX, IDC_EDIT_TEMPO, m_EditTempo); DDX_Control(pDX, IDC_SPIN_TEMPO, m_SpinTempo); DDX_Control(pDX, IDC_EDIT_SPEED, m_EditSpeed); DDX_Control(pDX, IDC_SPIN_SPEED, m_SpinSpeed); @@ -102,10 +102,13 @@ m_SliderVSTiVol.SetRange(0, MAX_SLIDER_VSTI_VOL); m_SliderSamplePreAmp.SetRange(0, MAX_SLIDER_SAMPLE_VOL); + m_SpinTempo.SetRange(-10, 10); m_SliderTempo.SetLineSize(1); m_SliderTempo.SetPageSize(10); + m_EditTempo.SubclassDlgItem(IDC_EDIT_TEMPO, this); + m_EditTempo.AllowSign(false); - m_bEditsLocked=false; + m_bEditsLocked = false; UpdateView(GeneralHint().ModType()); OnActivatePage(0); m_bInitialized = TRUE; @@ -178,16 +181,17 @@ if(delay) { uint32 newTempo = 60000 * numSamples; - if(m_sndFile.m_nTempoMode != tempo_mode_modern) + if(m_sndFile.m_nTempoMode != tempoModeModern) { newTempo = (newTempo * m_sndFile.m_nDefaultSpeed * m_sndFile.m_nDefaultRowsPerBeat) / 24; } - newTempo /= delay; + newTempo = Util::muldivr(newTempo, TEMPO::fractFact, delay); + TEMPO t; + t.SetRaw(newTempo); - int tempoMin, tempoMax; - m_SpinTempo.GetRange32(tempoMin, tempoMax); - Limit(newTempo, TEMPO(tempoMin), TEMPO(tempoMax)); - SetDlgItemInt(IDC_EDIT_TEMPO, newTempo, FALSE); + Limit(t, tempoMin, tempoMax); + if(!m_sndFile.GetModSpecifications().hasFractionalTempo) t.Set(t.GetInt(), 0); + m_EditTempo.SetTempoValue(t); } } @@ -233,14 +237,14 @@ else m_SpinSpeed.SetRange32(specs.speedMin, specs.speedMax); - TEMPO tempoMin = specs.tempoMin; + tempoMin = specs.tempoMin; tempoMax = specs.tempoMax; // IT Hack: There are legacy OpenMPT-made ITs out there which use a higher default speed than 255. // Changing the upper tempo limit in the mod specs would break them, so do it here instead. - if(m_sndFile.GetType() == MOD_TYPE_IT && m_sndFile.m_nDefaultTempo <= 255) - tempoMax = 255; - m_SliderTempo.SetRange(0, tempoMax - tempoMin); - m_SpinTempo.SetRange(tempoMin, tempoMax); + if(m_sndFile.GetType() == MOD_TYPE_IT && m_sndFile.m_nDefaultTempo <= TEMPO(255, 0)) + tempoMax.Set(255); + m_SliderTempo.SetRange(0, tempoMax.GetInt() - tempoMin.GetInt()); + m_EditTempo.AllowFractions(specs.hasFractionalTempo); const BOOL bIsNotMOD = (m_sndFile.GetType() != MOD_TYPE_MOD); const BOOL bIsNotMOD_S3M = ((bIsNotMOD) && (m_sndFile.GetType() != MOD_TYPE_S3M)); @@ -293,7 +297,7 @@ { m_EditTitle.SetWindowText(m_sndFile.GetTitle().c_str()); ::SetWindowTextW(m_EditArtist.m_hWnd, mpt::ToWide(m_sndFile.songArtist).c_str()); - SetDlgItemInt(IDC_EDIT_TEMPO, m_sndFile.m_nDefaultTempo, FALSE); + m_EditTempo.SetTempoValue(m_sndFile.m_nDefaultTempo); SetDlgItemInt(IDC_EDIT_SPEED, m_sndFile.m_nDefaultSpeed, FALSE); SetDlgItemInt(IDC_EDIT_GLOBALVOL, m_sndFile.m_nDefaultGlobalVolume / GetGlobalVolumeFactor(), FALSE); SetDlgItemInt(IDC_EDIT_RESTARTPOS, m_sndFile.m_nRestartPos, FALSE); @@ -304,7 +308,7 @@ m_SliderGlobalVol.SetPos(MAX_SLIDER_GLOBAL_VOL - m_sndFile.m_nDefaultGlobalVolume); m_SliderVSTiVol.SetPos(MAX_SLIDER_VSTI_VOL - m_sndFile.m_nVSTiVolume); m_SliderSamplePreAmp.SetPos(MAX_SLIDER_SAMPLE_VOL - m_sndFile.m_nSamplePreAmp); - m_SliderTempo.SetPos(tempoMax - m_sndFile.m_nDefaultTempo); + m_SliderTempo.SetPos((tempoMax - m_sndFile.m_nDefaultTempo).GetInt()); int srcMode = 0; for(int i = 0; i < CountOf(interpolationTypes); i++) @@ -332,20 +336,19 @@ { CSliderCtrl* pSlider = (CSliderCtrl*) pscroll; - if (pSlider==&m_SliderTempo) + if (pSlider == &m_SliderTempo) { - const TEMPO tempo = tempoMax - TEMPO(m_SliderTempo.GetPos()); + const TEMPO tempo = tempoMax - TEMPO(m_SliderTempo.GetPos(), 0); if ((tempo >= m_sndFile.GetModSpecifications().tempoMin) && (tempo <= m_sndFile.GetModSpecifications().tempoMax) && (tempo != m_sndFile.m_nDefaultTempo)) { - m_sndFile.m_nDefaultTempo = tempo; - m_sndFile.m_PlayState.m_nMusicTempo = tempo; + m_sndFile.m_nDefaultTempo = m_sndFile.m_PlayState.m_nMusicTempo = tempo; m_modDoc.SetModified(); m_modDoc.UpdateAllViews(nullptr, GeneralHint().General(), this); } } - else if (pSlider==&m_SliderGlobalVol) + else if (pSlider == &m_SliderGlobalVol) { const UINT gv = MAX_SLIDER_GLOBAL_VOL - m_SliderGlobalVol.GetPos(); if ((gv >= 0) && (gv <= MAX_SLIDER_GLOBAL_VOL) && (gv != m_sndFile.m_nDefaultGlobalVolume)) @@ -358,7 +361,7 @@ } } - else if (pSlider==&m_SliderSamplePreAmp) + else if (pSlider == &m_SliderSamplePreAmp) { const UINT spa = MAX_SLIDER_SAMPLE_VOL - m_SliderSamplePreAmp.GetPos(); if ((spa >= 0) && (spa <= MAX_SLIDER_SAMPLE_VOL) && (spa != m_sndFile.m_nSamplePreAmp)) @@ -370,7 +373,7 @@ } } - else if (pSlider==&m_SliderVSTiVol) + else if (pSlider == &m_SliderVSTiVol) { const UINT vv = MAX_SLIDER_VSTI_VOL - m_SliderVSTiVol.GetPos(); if ((vv >= 0) && (vv <= MAX_SLIDER_VSTI_VOL) && (vv != m_sndFile.m_nVSTiVolume)) @@ -382,6 +385,20 @@ } } + else if(pSlider == (CSliderCtrl*)&m_SpinTempo) + { + int pos = m_SpinTempo.GetPos32(); + if(pos != 0) + { + TEMPO newTempo = m_sndFile.m_nDefaultTempo + TEMPO(pos, 0); + Limit(newTempo, tempoMin, tempoMax); + m_sndFile.m_nDefaultTempo = m_sndFile.m_PlayState.m_nMusicTempo = newTempo; + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(nullptr, GeneralHint().General(), this); + } + m_SpinTempo.SetPos(0); + } + UpdateView(GeneralHint().General()); } } @@ -422,27 +439,20 @@ void CCtrlGeneral::OnTempoChanged() //--------------------------------- { - CHAR s[16]; - if (m_bInitialized) + if (m_bInitialized && m_EditTempo.GetWindowTextLength() > 0) { - m_EditTempo.GetWindowText(s, sizeof(s)); - if (s[0]) + TEMPO tempo = m_EditTempo.GetTempoValue(); + Limit(tempo, tempoMin, tempoMax); + if(!m_sndFile.GetModSpecifications().hasFractionalTempo) tempo.Set(tempo.GetInt()); + if (tempo != m_sndFile.m_nDefaultTempo) { - TEMPO n = TEMPO(atoi(s)); - int tempoMin, tempoMax; - m_SpinTempo.GetRange32(tempoMin, tempoMax); - n = Clamp(n, TEMPO(tempoMin), TEMPO(tempoMax)); - if (n != m_sndFile.m_nDefaultTempo) - { - m_bEditsLocked=true; - m_EditTempo.SetModify(FALSE); - m_sndFile.m_nDefaultTempo = n; - m_sndFile.m_PlayState.m_nMusicTempo = n; - m_modDoc.SetModified(); - m_modDoc.UpdateAllViews(nullptr, GeneralHint().General(), this); - UpdateView(GeneralHint().General()); - m_bEditsLocked=false; - } + m_bEditsLocked=true; + m_EditTempo.SetModify(FALSE); + m_sndFile.m_nDefaultTempo = tempo; + m_sndFile.m_PlayState.m_nMusicTempo = tempo; + m_modDoc.SetModified(); + m_modDoc.UpdateAllViews(nullptr, GeneralHint().General()); + m_bEditsLocked=false; } } } Modified: trunk/OpenMPT/mptrack/Ctrl_gen.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.h 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/Ctrl_gen.h 2015-05-31 17:22:30 UTC (rev 5217) @@ -11,6 +11,8 @@ #pragma once +#include "CDecimalSupport.h" + OPENMPT_NAMESPACE_BEGIN //========================= @@ -63,8 +65,9 @@ bool m_bEditsLocked; //{{AFX_DATA(CCtrlGeneral) CEdit m_EditTitle, m_EditArtist; - CEdit m_EditTempo, m_EditSpeed, m_EditGlobalVol, m_EditRestartPos, + CEdit m_EditSpeed, m_EditGlobalVol, m_EditRestartPos, m_EditSamplePA, m_EditVSTiVol; + CNumberEdit m_EditTempo; CButton m_BtnModType; CSpinButtonCtrl m_SpinTempo, m_SpinSpeed, m_SpinGlobalVol, m_SpinRestartPos, m_SpinSamplePA, m_SpinVSTiVol; @@ -73,7 +76,7 @@ CSliderCtrl m_SliderTempo, m_SliderSamplePreAmp, m_SliderGlobalVol, m_SliderVSTiVol; CVuMeter m_VuMeterLeft, m_VuMeterRight; - TEMPO tempoMax; + TEMPO tempoMin, tempoMax; //}}AFX_DATA //{{AFX_VIRTUAL(CCtrlGeneral) virtual BOOL OnInitDialog(); Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -1,5 +1,5 @@ /* - * ctrl_ins.cpp + * Ctrl_ins.cpp * ------------ * Purpose: Instrument tab, upper panel. * Notes : (currently none) @@ -15,6 +15,7 @@ #include "InputHandler.h" #include "Childfrm.h" #include "Moddoc.h" +#include "../soundlib/mod_specifications.h" #include "Globals.h" #include "Ctrl_ins.h" #include "View_ins.h" @@ -835,7 +836,6 @@ DDX_Control(pDX, IDC_SPIN12, m_SpinPPS); DDX_Control(pDX, IDC_EDIT8, m_EditGlobalVol); DDX_Control(pDX, IDC_EDIT9, m_EditPanning); - DDX_Control(pDX, IDC_EDIT15, m_EditPPS); DDX_Control(pDX, IDC_CHECK1, m_CheckPanning); DDX_Control(pDX, IDC_CHECK2, m_CheckCutOff); DDX_Control(pDX, IDC_CHECK3, m_CheckResonance); @@ -849,10 +849,9 @@ DDX_Control(pDX, IDC_SPIN1, m_SpinAttack); DDX_Control(pDX, IDC_COMBOTUNING, m_ComboTuning); DDX_Control(pDX, IDC_CHECK_PITCHTEMPOLOCK, m_CheckPitchTempoLock); - DDX_Control(pDX, IDC_EDIT_PITCHTEMPOLOCK, m_EditPitchTempoLock); DDX_Control(pDX, IDC_PLUGIN_VOLUMESTYLE, m_CbnPluginVolumeHandling); DDX_Control(pDX, IDC_PLUGIN_VELOCITYSTYLE, velocityStyle); - DDX_Control(pDX, IDC_SPIN2, pwdSpin); + DDX_Control(pDX, IDC_SPIN2, m_SpinPWD); //}}AFX_DATA_MAP } @@ -918,6 +917,9 @@ m_SpinMidiPR.SetRange(0, 128); // Midi Bank m_SpinMidiBK.SetRange(0, 16384); + // MIDI Pitch Wheel Depth + m_EditPWD.SubclassDlgItem(IDC_PITCHWHEELDEPTH, this); + m_EditPWD.AllowFractions(false); m_CbnResampling.SetItemData(m_CbnResampling.AddString("Default"), SRCMODE_DEFAULT); m_CbnResampling.SetItemData(m_CbnResampling.AddString("None"), SRCMODE_NEAREST); @@ -944,6 +946,8 @@ m_SliderCutOff.SetRange(0x00, 0x7F); m_SliderResonance.SetRange(0x00, 0x7F); // Pitch/Pan Separation + m_EditPPS.SubclassDlgItem(IDC_EDIT15, this); + m_EditPPS.AllowFractions(false); m_SpinPPS.SetRange(-32, +32); // Pitch/Pan Center AppendNotesToControl(m_ComboPPC, 0, NOTE_MAX - NOTE_MIN); @@ -955,12 +959,14 @@ m_SpinInstrument.SetFocus(); - GetDlgItem(IDC_PITCHWHEELDEPTH)->EnableWindow(FALSE); + m_EditPWD.EnableWindow(FALSE); BuildTuningComboBox(); CheckDlgButton(IDC_CHECK_PITCHTEMPOLOCK, MF_UNCHECKED); - m_EditPitchTempoLock.SetLimitText(4); + m_EditPitchTempoLock.SubclassDlgItem(IDC_EDIT_PITCHTEMPOLOCK, this); + m_EditPitchTempoLock.AllowSign(false); + m_EditPitchTempoLock.SetLimitText(9); SetRedraw(TRUE); return FALSE; @@ -1186,11 +1192,11 @@ // Pitch Wheel Depth if(m_sndFile.GetType() == MOD_TYPE_XM) - pwdSpin.SetRange(0, 36); + m_SpinPWD.SetRange(0, 36); else - pwdSpin.SetRange(-128, 127); - GetDlgItem(IDC_PITCHWHEELDEPTH)->EnableWindow(bITandXM); - pwdSpin.EnableWindow(bITandXM); + m_SpinPWD.SetRange(-128, 127); + m_EditPWD.EnableWindow(bITandXM); + m_SpinPWD.EnableWindow(bITandXM); m_NoteMap.EnableWindow(bITandXM); m_CbnResampling.EnableWindow(bITandXM); @@ -1225,11 +1231,11 @@ { CString s; if (ich == MidiNoChannel) - s = "None"; + s = _T("None"); else if (ich == MidiMappedChannel) - s = "Mapped"; + s = _T("Mapped"); else - s.Format("%d", ich); + s.Format(_T("%u"), ich); m_CbnMidiCh.SetItemData(m_CbnMidiCh.AddString(s), ich); } } @@ -1255,11 +1261,11 @@ if (pIns->nMidiProgram>0 && pIns->nMidiProgram<=128) SetDlgItemInt(IDC_EDIT10, pIns->nMidiProgram); else - SetDlgItemText(IDC_EDIT10, "---"); + SetDlgItemText(IDC_EDIT10, _T("---")); if (pIns->wMidiBank && pIns->wMidiBank <= 16384) SetDlgItemInt(IDC_EDIT11, pIns->wMidiBank); else - SetDlgItemText(IDC_EDIT11, "---"); + SetDlgItemText(IDC_EDIT11, _T("---")); if (pIns->nMidiChannel < 18) { @@ -1310,7 +1316,7 @@ m_ComboPPC.SetRedraw(TRUE); } m_ComboPPC.SetCurSel(pIns->nPPC); - ASSERT(m_ComboPPC.GetItemData(m_ComboPPC.GetCurSel()) == pIns->nPPC + NOTE_MIN); + ASSERT((uint8)m_ComboPPC.GetItemData(m_ComboPPC.GetCurSel()) == pIns->nPPC + NOTE_MIN); SetDlgItemInt(IDC_EDIT15, pIns->nPPS); // Filter if (m_sndFile.GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) @@ -1334,12 +1340,12 @@ UpdateTuningComboBox(); // Only enable Pitch/Tempo Lock for MPTM files or legacy files that have this property enabled. - m_CheckPitchTempoLock.EnableWindow((m_sndFile.GetType() == MOD_TYPE_MPT || pIns->wPitchToTempoLock > 0) ? TRUE : FALSE); - CheckDlgButton(IDC_CHECK_PITCHTEMPOLOCK, pIns->wPitchToTempoLock > 0 ? MF_CHECKED : MF_UNCHECKED); - m_EditPitchTempoLock.EnableWindow(pIns->wPitchToTempoLock > 0 ? TRUE : FALSE); - if(pIns->wPitchToTempoLock > 0) + m_CheckPitchTempoLock.EnableWindow((m_sndFile.GetType() == MOD_TYPE_MPT || pIns->pitchToTempoLock.GetRaw() > 0) ? TRUE : FALSE); + CheckDlgButton(IDC_CHECK_PITCHTEMPOLOCK, pIns->pitchToTempoLock.GetRaw() > 0 ? MF_CHECKED : MF_UNCHECKED); + m_EditPitchTempoLock.EnableWindow(pIns->pitchToTempoLock.GetRaw() > 0 ? TRUE : FALSE); + if(pIns->pitchToTempoLock.GetRaw() > 0) { - m_EditPitchTempoLock.SetWindowText(mpt::ToString(pIns->wPitchToTempoLock).c_str()); + m_EditPitchTempoLock.SetTempoValue(pIns->pitchToTempoLock); } // Pitch Wheel Depth @@ -1397,20 +1403,20 @@ ModInstrument *pIns = m_sndFile.Instruments[m_nInstrument]; if(pIns) { - CHAR s[32]; + TCHAR s[32]; // In IT Compatible mode, it is enough to just have resonance enabled to turn on the filter. const bool resEnabled = (pIns->IsResonanceEnabled() && pIns->GetResonance() > 0 && m_sndFile.IsCompatibleMode(TRK_IMPULSETRACKER)); if((pIns->IsCutoffEnabled() && pIns->GetCutoff() < 0x7F) || resEnabled) { const BYTE cutoff = (resEnabled && !pIns->IsCutoffEnabled()) ? 0x7F : pIns->GetCutoff(); - wsprintf(s, "Z%02X (%d Hz)", cutoff, m_sndFile.CutOffToFrequency(cutoff)); + wsprintf(s, _T("Z%02X (%u Hz)"), cutoff, m_sndFile.CutOffToFrequency(cutoff)); } else if(pIns->IsCutoffEnabled()) { - strcpy(s, "Z7F (Off)"); + _tcscpy(s, _T("Z7F (Off)")); } else { - strcpy(s, "No Change"); + _tcscpy(s, _T("No Change")); } SetDlgItemText(IDC_FILTERTEXT, s); @@ -1556,15 +1562,13 @@ // Pitch/Tempo lock { const CModSpecifications& specs = m_sndFile.GetModSpecifications(); - std::string str = std::string("Tempo range: ") + mpt::ToString(specs.tempoMin) + std::string(" - ") + mpt::ToString(specs.tempoMax); - if(str.size() >= 250) str.resize(250); - strcpy(pszText, str.c_str()); + wsprintf(pszText, _T("Tempo range: %u - %u"), specs.tempoMin.GetInt(), specs.tempoMax.GetInt()); return TRUE; } case IDC_EDIT7: // Fade Out - wsprintf(pszText, "Higher value <-> Faster fade out"); + _tcscpy(pszText, _T("Higher value <-> Faster fade out")); return TRUE; case IDC_PLUGIN_VELOCITYSTYLE: @@ -1575,13 +1579,13 @@ { velocityStyle.EnableWindow(FALSE); m_CbnPluginVolumeHandling.EnableWindow(FALSE); - strcpy(pszText, "To enable, clear Plugin volume command bug emulation flag from Song Properties"); + _tcscpy(pszText, ("To enable, clear Plugin volume command bug emulation flag from Song Properties")); return TRUE; } else { if(uId == IDC_PLUGIN_VELOCITYSTYLE) { - strcpy(pszText, "Volume commands (vxx) next to a note are sent as note velocity instead."); + _tcscpy(pszText, _T("Volume commands (vxx) next to a note are sent as note velocity instead.")); return TRUE; } return FALSE; @@ -1589,7 +1593,7 @@ case IDC_COMBO5: // MIDI Channel - strcpy(pszText, "Mapped: MIDI channel corresponds to pattern channel modulo 16"); + _tcscpy(pszText, _T("Mapped: MIDI channel corresponds to pattern channel modulo 16")); return TRUE; case IDC_SLIDER1: @@ -1601,11 +1605,11 @@ return TRUE; case IDC_SLIDER3: - wsprintf(pszText, "%d", pIns->GetCutoff()); + wsprintf(pszText, _T("%u"), pIns->GetCutoff()); return TRUE; case IDC_SLIDER4: - wsprintf(pszText, "%d", pIns->GetResonance()); + wsprintf(pszText, _T("%u"), pIns->GetResonance()); return TRUE; case IDC_SLIDER6: @@ -1617,7 +1621,7 @@ return TRUE; case IDC_PITCHWHEELDEPTH: - strcpy(pszText, "Set this to the actual Pitch Wheel Depth used in your plugin on this channel."); + _tcscpy(pszText, _T("Set this to the actual Pitch Wheel Depth used in your plugin on this channel.")); return TRUE; } @@ -1755,7 +1759,7 @@ void CCtrlInstruments::OnInstrumentSave() //--------------------------------------- { - TCHAR szFileName[_MAX_PATH] = ""; + TCHAR szFileName[_MAX_PATH] = _T(""); ModInstrument *pIns = m_sndFile.Instruments[m_nInstrument]; if (!pIns) return; @@ -1820,7 +1824,7 @@ { if (!IsLocked()) { - CHAR s[64]; + TCHAR s[64]; s[0] = 0; m_EditName.GetWindowText(s, sizeof(s)); ModInstrument *pIns = m_sndFile.Instruments[m_nInstrument]; @@ -1838,7 +1842,7 @@ { if (!IsLocked()) { - CHAR s[64]; + TCHAR s[64]; s[0] = 0; m_EditFileName.GetWindowText(s, sizeof(s)); ModInstrument *pIns = m_sndFile.Instruments[m_nInstrument]; @@ -1906,7 +1910,7 @@ for(std::set<SAMPLEINDEX>::const_iterator sample = referencedSamples.begin(); sample != referencedSamples.end(); sample++) { - if(*sample <= m_sndFile.GetNumSamples() && m_sndFile.GetSample(*sample).uFlags & CHN_PANNING) + if(*sample <= m_sndFile.GetNumSamples() && m_sndFile.GetSample(*sample).uFlags[CHN_PANNING]) { smpPanningInUse = true; break; @@ -1920,11 +1924,11 @@ "Do you wish to disable panning from those samples so that the instrument pan setting is effective " "for the whole instrument?")) == cnfYes) { - for(BYTE i = 0; i < CountOf(pIns->Keyboard); i++) + for(size_t i = 0; i < CountOf(pIns->Keyboard); i++) { const SAMPLEINDEX smp = pIns->Keyboard[i]; if(smp > 0 && smp <= m_sndFile.GetNumSamples()) - m_sndFile.GetSample(smp).uFlags &= ~CHN_PANNING; + m_sndFile.GetSample(smp).uFlags.reset(CHN_PANNING); } m_modDoc.UpdateAllViews(nullptr, SampleHint().Info().ModType(), this); } @@ -2016,10 +2020,10 @@ } } // we will not set the midi bank/program if it is 0 - if (n == 0) + if(n == 0) { LockControls(); - SetDlgItemText(IDC_EDIT10, "---"); + SetDlgItemText(IDC_EDIT10, _T("---")); UnlockControls(); } } @@ -2032,17 +2036,17 @@ ModInstrument *pIns = m_sndFile.Instruments[m_nInstrument]; if ((!IsLocked()) && (pIns)) { - WORD w = GetDlgItemInt(IDC_EDIT11); + uint16 w = GetDlgItemInt(IDC_EDIT11); if(w >= 0 && w <= 16384 && pIns->wMidiBank != w) { pIns->wMidiBank = w; SetModified(InstrumentHint().Info(), false); } - // we will not set the midi bank/program if it is 0 + // we will not set the midi bank/program if it is 0 if(w == 0) { LockControls(); - SetDlgItemText(IDC_EDIT11, "---"); + SetDlgItemText(IDC_EDIT11, _T("---")); UnlockControls(); } } @@ -2070,10 +2074,10 @@ ModInstrument *pIns = m_sndFile.Instruments[m_nInstrument]; if ((!IsLocked()) && (pIns)) { - int n = m_CbnResampling.GetItemData(m_CbnResampling.GetCurSel()); - if (pIns->nResampling != (BYTE)(n & 0xff)) + uint32 n = m_CbnResampling.GetItemData(m_CbnResampling.GetCurSel()); + if (pIns->nResampling != n) { - pIns->nResampling = (BYTE)(n & 0xff); + pIns->nResampling = n; SetModified(InstrumentHint().Info(), false); } } @@ -2183,7 +2187,8 @@ if ((!IsLocked()) && (pIns)) { int n = GetDlgItemInt(IDC_EDIT15); - if ((n >= -32) && (n <= 32)) { + if ((n >= -32) && (n <= 32)) + { if (pIns->nPPS != (signed char)n) { pIns->nPPS = (signed char)n; @@ -2327,6 +2332,7 @@ void CCtrlInstruments::OnVScroll(UINT nCode, UINT nPos, CScrollBar *pSB) //---------------------------------------------------------------------- { + // Give focus back to envelope editor when stopping to scroll spin buttons (for instrument preview keyboard focus) CModControlDlg::OnVScroll(nCode, nPos, pSB); if (nCode == SB_ENDSCROLL) SwitchToView(); } @@ -2697,10 +2703,9 @@ if(!IsLocked() && pIns != nullptr) { int pwd = GetDlgItemInt(IDC_PITCHWHEELDEPTH, NULL, TRUE); - if(m_sndFile.GetType() == MOD_TYPE_XM) - Limit(pwd, 0, 36); - else - Limit(pwd, -128, 127); + int lower = -128, upper = 127; + m_SpinPWD.GetRange32(lower, upper); + Limit(pwd, lower, upper); if(pwd != pIns->midiPWD) { pIns->midiPWD = static_cast<int8>(pwd); @@ -2726,24 +2731,22 @@ if(IsDlgButtonChecked(IDC_CHECK_PITCHTEMPOLOCK)) { //Checking what value to put for the wPitchToTempoLock. - uint16 ptl = 0; + TEMPO ptl; if(m_EditPitchTempoLock.GetWindowTextLength() > 0) { - TCHAR buffer[8]; - m_EditPitchTempoLock.GetWindowText(buffer, CountOf(buffer)); - ptl = _ttoi(buffer); + ptl = m_EditPitchTempoLock.GetTempoValue(); } - if(!ptl) + if(!ptl.GetRaw()) { ptl = m_sndFile.m_nDefaultTempo; } - m_EditPitchTempoLock.SetWindowText(mpt::ToString(ptl).c_str()); + m_EditPitchTempoLock.SetTempoValue(ptl); for(INSTRUMENTINDEX i = firstIns; i <= lastIns; i++) { - if(m_sndFile.Instruments[i] != nullptr && m_sndFile.Instruments[i]->wPitchToTempoLock == 0) + if(m_sndFile.Instruments[i] != nullptr && m_sndFile.Instruments[i]->pitchToTempoLock.GetRaw() == 0) { - m_sndFile.Instruments[i]->wPitchToTempoLock = ptl; + m_sndFile.Instruments[i]->pitchToTempoLock = ptl; m_modDoc.SetModified(); } } @@ -2751,9 +2754,9 @@ { for(INSTRUMENTINDEX i = firstIns; i <= lastIns; i++) { - if(m_sndFile.Instruments[i] != nullptr && m_sndFile.Instruments[i]->wPitchToTempoLock != 0) + if(m_sndFile.Instruments[i] != nullptr && m_sndFile.Instruments[i]->pitchToTempoLock.GetRaw() != 0) { - m_sndFile.Instruments[i]->wPitchToTempoLock = 0; + m_sndFile.Instruments[i]->pitchToTempoLock.Set(0); m_modDoc.SetModified(); } } @@ -2767,12 +2770,10 @@ { if(IsLocked() || !m_nInstrument || !m_sndFile.Instruments[m_nInstrument]) return; - TCHAR buffer[8]; - m_EditPitchTempoLock.GetWindowText(buffer, CountOf(buffer)); - TEMPO ptlTempo = _ttoi(buffer); + TEMPO ptlTempo = m_EditPitchTempoLock.GetTempoValue(); Limit(ptlTempo, m_sndFile.GetModSpecifications().tempoMin, m_sndFile.GetModSpecifications().tempoMax); - m_sndFile.Instruments[m_nInstrument]->wPitchToTempoLock = ptlTempo; + m_sndFile.Instruments[m_nInstrument]->pitchToTempoLock = ptlTempo; m_modDoc.SetModified(); // Only update other views after killing focus } @@ -2783,9 +2784,7 @@ //Checking that tempo value is in correct range. if(IsLocked()) return; - TCHAR buffer[8]; - m_EditPitchTempoLock.GetWindowText(buffer, CountOf(buffer)); - int ptlTempo = _ttoi(buffer); + TEMPO ptlTempo = m_EditPitchTempoLock.GetTempoValue(); bool changed = false; const CModSpecifications& specs = m_sndFile.GetModSpecifications(); @@ -2793,16 +2792,14 @@ { ptlTempo = specs.tempoMin; changed = true; - } - if(ptlTempo > specs.tempoMax) + } else if(ptlTempo > specs.tempoMax) { ptlTempo = specs.tempoMax; changed = true; - } if(changed) { - m_EditPitchTempoLock.SetWindowText(mpt::ToString(ptlTempo).c_str()); + m_EditPitchTempoLock.SetTempoValue(ptlTempo); m_modDoc.SetModified(); } m_modDoc.UpdateAllViews(nullptr, InstrumentHint().Info(), this); Modified: trunk/OpenMPT/mptrack/Ctrl_ins.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.h 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/Ctrl_ins.h 2015-05-31 17:22:30 UTC (rev 5217) @@ -11,6 +11,8 @@ #pragma once +#include "CDecimalSupport.h" + OPENMPT_NAMESPACE_BEGIN class CNoteMapWnd; @@ -92,9 +94,10 @@ protected: CModControlBar m_ToolBar; CSpinButtonCtrl m_SpinInstrument, m_SpinFadeOut, m_SpinGlobalVol, m_SpinPanning; - CSpinButtonCtrl m_SpinMidiPR, m_SpinPPS, m_SpinMidiBK, pwdSpin; + CSpinButtonCtrl m_SpinMidiPR, m_SpinPPS, m_SpinMidiBK, m_SpinPWD; CComboBox m_ComboNNA, m_ComboDCT, m_ComboDCA, m_ComboPPC, m_CbnMidiCh, m_CbnMixPlug, m_CbnResampling, m_CbnFilterMode, m_CbnPluginVolumeHandling; - CEdit m_EditName, m_EditFileName, m_EditGlobalVol, m_EditPanning, m_EditPPS, m_EditFadeOut; + CEdit m_EditName, m_EditFileName, m_EditGlobalVol, m_EditPanning, m_EditFadeOut; + CNumberEdit m_EditPPS, m_EditPWD; CButton m_CheckPanning, m_CheckCutOff, m_CheckResonance, velocityStyle; CSliderCtrl m_SliderVolSwing, m_SliderPanSwing, m_SliderCutSwing, m_SliderResSwing, m_SliderCutOff, m_SliderResonance; @@ -113,7 +116,7 @@ void UpdatePluginList(); //Pitch/Tempo lock - CEdit m_EditPitchTempoLock; + CNumberEdit m_EditPitchTempoLock; CButton m_CheckPitchTempoLock; @@ -165,10 +168,10 @@ afx_msg void OnDCTChanged(); afx_msg void OnDCAChanged(); afx_msg void OnMPRChanged(); - afx_msg void OnMBKChanged(); //rewbs.MidiBank + afx_msg void OnMBKChanged(); afx_msg void OnMCHChanged(); afx_msg void OnResamplingChanged(); - afx_msg void OnMixPlugChanged(); //rewbs.instroVSTi + afx_msg void OnMixPlugChanged(); afx_msg void OnPPSChanged(); afx_msg void OnPPCChanged(); afx_msg void OnFilterModeChanged(); @@ -176,18 +179,12 @@ afx_msg void OnPluginVolumeHandlingChanged(); afx_msg void OnPitchWheelDepthChanged(); afx_msg void OnOpenPluginList() { openendPluginListWithMouse = true; } - - -// -> CODE#0027 -// -> DESC="per-instrument volume ramping setup (refered as attack)" afx_msg void OnAttackChanged(); -// -! NEW_FEATURE#0027 - afx_msg void OnEnableCutOff(); afx_msg void OnEnableResonance(); afx_msg void OnEditSampleMap(); - afx_msg void TogglePluginEditor(); //rewbs.instroVSTi - afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys + afx_msg void TogglePluginEditor(); + afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); afx_msg void OnCbnSelchangeCombotuning(); afx_msg void OnEnChangeEditPitchtempolock(); afx_msg void OnBnClickedCheckPitchtempolock(); Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -10,14 +10,15 @@ #include "stdafx.h" -#include "mptrack.h" +#include "Mptrack.h" #include "mainfrm.h" #include "InputHandler.h" -#include "childfrm.h" -#include "moddoc.h" -#include "globals.h" -#include "ctrl_pat.h" -#include "view_pat.h" +#include "Childfrm.h" +#include "Moddoc.h" +#include "../soundlib/mod_specifications.h" +#include "Globals.h" +#include "Ctrl_pat.h" +#include "View_pat.h" #include "PatternEditorDialogs.h" #include "ChannelManagerDlg.h" #include "../common/StringFixer.h" Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -15,6 +15,7 @@ #include "View_tre.h" #include "InputHandler.h" #include "Moddoc.h" +#include "../soundlib/mod_specifications.h" #include "Globals.h" #include "Ctrl_pat.h" #include "PatternClipboard.h" Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2015-05-31 14:37:32 UTC (rev 5216) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2015-05-31 17:22:30 UTC (rev 5217) @@ -10,14 +10,15 @@ #include "stdafx.h" -#include "mptrack.h" -#include "mainfrm.h" +#include "Mptrack.h" +#include "Mainfrm.h" #include "InputHandler.h"... [truncated message content] |
From: <sag...@us...> - 2015-06-01 21:56:32
|
Revision: 5228 http://sourceforge.net/p/modplug/code/5228 Author: saga-games Date: 2015-06-01 21:56:24 +0000 (Mon, 01 Jun 2015) Log Message: ----------- [Ref] Remove Wav.h and move the remaining required FOURCCs to Dlsbank.cpp, which is now the only usage site. Modified Paths: -------------- trunk/OpenMPT/build/autotools/Makefile.am trunk/OpenMPT/build/vs2008/OpenMPT.vcproj trunk/OpenMPT/build/vs2008/libopenmpt.vcproj trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj.filters trunk/OpenMPT/mptrack/mod2midi.cpp trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters trunk/OpenMPT/soundlib/Dlsbank.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp Removed Paths: ------------- trunk/OpenMPT/soundlib/Wav.h Modified: trunk/OpenMPT/build/autotools/Makefile.am =================================================================== --- trunk/OpenMPT/build/autotools/Makefile.am 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/autotools/Makefile.am 2015-06-01 21:56:24 UTC (rev 5228) @@ -217,7 +217,6 @@ libopenmpt_la_SOURCES += soundlib/tuning.cpp libopenmpt_la_SOURCES += soundlib/tuning.h libopenmpt_la_SOURCES += soundlib/UpgradeModule.cpp -libopenmpt_la_SOURCES += soundlib/Wav.h libopenmpt_la_SOURCES += soundlib/WAVTools.cpp libopenmpt_la_SOURCES += soundlib/WAVTools.h libopenmpt_la_SOURCES += soundlib/WindowedFIR.cpp @@ -421,7 +420,6 @@ libopenmpttest_SOURCES += soundlib/tuning.cpp libopenmpttest_SOURCES += soundlib/tuning.h libopenmpttest_SOURCES += soundlib/UpgradeModule.cpp -libopenmpttest_SOURCES += soundlib/Wav.h libopenmpttest_SOURCES += soundlib/WAVTools.cpp libopenmpttest_SOURCES += soundlib/WAVTools.h libopenmpttest_SOURCES += soundlib/WindowedFIR.cpp Modified: trunk/OpenMPT/build/vs2008/OpenMPT.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/OpenMPT.vcproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2008/OpenMPT.vcproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -1980,10 +1980,6 @@ > </File> <File - RelativePath="..\..\soundlib\Wav.h" - > - </File> - <File RelativePath="..\..\soundlib\WindowedFIR.cpp" > </File> Modified: trunk/OpenMPT/build/vs2008/libopenmpt.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/libopenmpt.vcproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2008/libopenmpt.vcproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -871,10 +871,6 @@ > </File> <File - RelativePath="..\..\soundlib\Wav.h" - > - </File> - <File RelativePath="..\..\soundlib\WindowedFIR.cpp" > </File> Modified: trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -919,10 +919,6 @@ > </File> <File - RelativePath="..\..\soundlib\Wav.h" - > - </File> - <File RelativePath="..\..\soundlib\WindowedFIR.cpp" > </File> Modified: trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -919,10 +919,6 @@ > </File> <File - RelativePath="..\..\soundlib\Wav.h" - > - </File> - <File RelativePath="..\..\soundlib\WindowedFIR.cpp" > </File> Modified: trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -504,7 +504,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -509,9 +509,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -238,7 +238,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -207,9 +207,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -242,7 +242,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -207,9 +207,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -246,7 +246,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -210,9 +210,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -510,7 +510,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -509,9 +509,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -242,7 +242,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -207,9 +207,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -246,7 +246,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -207,9 +207,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -250,7 +250,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -210,9 +210,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -511,7 +511,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -509,9 +509,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -243,7 +243,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -207,9 +207,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -247,7 +247,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -207,9 +207,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -251,7 +251,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -210,9 +210,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -511,7 +511,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -509,9 +509,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -243,7 +243,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -207,9 +207,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -247,7 +247,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -207,9 +207,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -251,7 +251,6 @@ <ClInclude Include="..\..\soundlib\Tables.h" /> <ClInclude Include="..\..\soundlib\Tagging.h" /> <ClInclude Include="..\..\soundlib\WAVTools.h" /> - <ClInclude Include="..\..\soundlib\Wav.h" /> <ClInclude Include="..\..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\..\soundlib\XMTools.h" /> <ClInclude Include="..\..\soundlib\mod_specifications.h" /> Modified: trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -210,9 +210,6 @@ <ClInclude Include="..\..\soundlib\WAVTools.h"> <Filter>soundlib</Filter> </ClInclude> - <ClInclude Include="..\..\soundlib\Wav.h"> - <Filter>soundlib</Filter> - </ClInclude> <ClInclude Include="..\..\soundlib\WindowedFIR.h"> <Filter>soundlib</Filter> </ClInclude> Modified: trunk/OpenMPT/mptrack/mod2midi.cpp =================================================================== --- trunk/OpenMPT/mptrack/mod2midi.cpp 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/mptrack/mod2midi.cpp 2015-06-01 21:56:24 UTC (rev 5228) @@ -14,7 +14,6 @@ #include "../common/StringFixer.h" #include "../common/mptFileIO.h" #include "mod2midi.h" -#include "Wav.h" OPENMPT_NAMESPACE_BEGIN @@ -26,30 +25,30 @@ typedef struct PACKED _RMIDDATACHUNK { - DWORD id_RIFF; // "RIFF" - DWORD filelen; - DWORD id_RMID; // "RMID" - DWORD id_data; // "data" - DWORD datalen; + char id_RIFF[4]; // "RIFF" + uint32 filelen; + char id_RMID[4]; // "RMID" + char id_data[4]; // "data" + uint32 datalen; } RMIDDATACHUNK, *PRMIDDATACHUNK; STATIC_ASSERT(sizeof(RMIDDATACHUNK) == 20); typedef struct PACKED _MTHDCHUNK // (big endian) { - DWORD id; // "MThd" = 0x6468544D - DWORD len; // 6 - WORD wFmt; // 0=single track, 1=synchro multitrack, 2=asynch multitrack - WORD wTrks; // # of tracks - WORD wDivision; // PPQN + char id[4]; // "MThd" = 0x6468544D + uint32 len; // 6 + uint16 wFmt; // 0=single track, 1=synchro multitrack, 2=asynch multitrack + uint16 wTrks; // # of tracks + uint16 wDivision; // PPQN } MTHDCHUNK, *PMTHDCHUNK; STATIC_ASSERT(sizeof(MTHDCHUNK) == 14); typedef struct PACKED _MTRKCHUNK // (big endian) { - DWORD id; // "MTrk" = 0x6B72544D - DWORD len; + char id[4]; // "MTrk" = 0x6B72544D + uint32 len; } MTRKCHUNK, *PMTRKCHUNK; STATIC_ASSERT(sizeof(MTRKCHUNK) == 8); @@ -385,12 +384,12 @@ if (!tempo) tempo = 125; nTickMultiplier = MOD2MIDI_TEMPOFACTOR; const uint16 wPPQN = static_cast<uint16>((tempo * nTickMultiplier) / 5); - rmid.id_RIFF = IFFID_RIFF; + memcpy(rmid.id_RIFF, "RIFF", 4); rmid.filelen = sizeof(rmid)+sizeof(mthd)-8; - rmid.id_RMID = 0x44494D52; // "RMID" - rmid.id_data = IFFID_data; + memcpy(rmid.id_RMID, "RMID", 4); + memcpy(rmid.id_data, "data", 4); rmid.datalen = 0; - mthd.id = 0x6468544d; // "MThd" + memcpy(mthd.id, "MThd", 4); mthd.len = BigEndian(sizeof(mthd)-8); mthd.wFmt = BigEndianW(1); mthd.wTrks = static_cast<uint16>(Tracks.size()); // 1 track/channel @@ -568,7 +567,7 @@ tmp[2] = 0x2f; tmp[3] = 0x00; Tracks[iTrk].Write(tmp, 4); - mtrk.id = 0x6B72544D; + memcpy(mtrk.id, "MTrk", 4); mtrk.len = BigEndian(Tracks[iTrk].nTrackSize); fwrite(&mtrk, 1, sizeof(mtrk), f); rmid.filelen += sizeof(mtrk) + Tracks[iTrk].nTrackSize; Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -1678,10 +1678,6 @@ > </File> <File - RelativePath="..\soundlib\Wav.h" - > - </File> - <File RelativePath=".\WelcomeDialog.h" > </File> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2015-06-01 21:56:24 UTC (rev 5228) @@ -1024,7 +1024,6 @@ <ClInclude Include="..\soundlib\SoundFilePlayConfig.h" /> <ClInclude Include="..\soundlib\Tables.h" /> <ClInclude Include="..\soundlib\Tagging.h" /> - <ClInclude Include="..\soundlib\Wav.h" /> <ClInclude Include="..\soundlib\WAVTools.h" /> <ClInclude Include="..\soundlib\WindowedFIR.h" /> <ClInclude Include="..\soundlib\XMTools.h" /> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2015-06-01 21:56:24 UTC (rev 5228) @@ -741,9 +741,6 @@ <ClInclude Include="..\soundlib\Tables.h"> <Filter>Header Files\soundlib</Filter> </ClInclude> - <ClInclude Include="..\soundlib\Wav.h"> - <Filter>Header Files\soundlib</Filter> - </ClInclude> <ClInclude Include="..\common\AudioCriticalSection.h"> <Filter>Header Files\common</Filter> </ClInclude> Modified: trunk/OpenMPT/soundlib/Dlsbank.cpp =================================================================== --- trunk/OpenMPT/soundlib/Dlsbank.cpp 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/soundlib/Dlsbank.cpp 2015-06-01 21:56:24 UTC (rev 5228) @@ -16,7 +16,6 @@ #include "../common/mptFileIO.h" #endif #include "Dlsbank.h" -#include "Wav.h" #include "../common/StringFixer.h" #include "../common/FileReader.h" #include "../common/Endianness.h" @@ -120,14 +119,29 @@ ////////////////////////////////////////////////////////// // DLS IFF Chunk IDs +// Standard IFF chunks IDs +#define IFFID_FORM 0x4d524f46 +#define IFFID_RIFF 0x46464952 +#define IFFID_LIST 0x5453494C +#define IFFID_INFO 0x4F464E49 + +// IFF Info fields +#define IFFID_ICOP 0x504F4349 +#define IFFID_INAM 0x4D414E49 +#define IFFID_ICMT 0x544D4349 +#define IFFID_IENG 0x474E4549 +#define IFFID_ISFT 0x54465349 +#define IFFID_ISBJ 0x4A425349 + +// Wave IFF chunks IDs +#define IFFID_wave 0x65766177 +#define IFFID_wsmp 0x706D7377 + #define IFFID_XDLS 0x534c4458 #define IFFID_DLS 0x20534C44 #define IFFID_MLS 0x20534C4D #define IFFID_RMID 0x44494D52 #define IFFID_colh 0x686C6F63 -#define IFFID_vers 0x73726576 -#define IFFID_msyn 0x6E79736D -#define IFFID_lins 0x736E696C #define IFFID_ins 0x20736E69 #define IFFID_insh 0x68736E69 #define IFFID_ptbl 0x6C627470 Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2015-06-01 21:56:24 UTC (rev 5228) @@ -21,7 +21,6 @@ #ifndef MODPLUG_NO_FILESAVE #include "../common/mptFileIO.h" #endif -#include "Wav.h" #include "Tagging.h" #include "ITTools.h" #include "XMTools.h" Deleted: trunk/OpenMPT/soundlib/Wav.h =================================================================== --- trunk/OpenMPT/soundlib/Wav.h 2015-06-01 14:41:28 UTC (rev 5227) +++ trunk/OpenMPT/soundlib/Wav.h 2015-06-01 21:56:24 UTC (rev 5228) @@ -1,68 +0,0 @@ -/* - * Wav.h - * ----- - * Purpose: Headers for WAV reading / writing (WAV structs, FOURCCs, etc...) - * Notes : Some FOURCCs are also used by the MIDI/DLS routines. - * Authors: OpenMPT Devs - * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. - */ - - -#pragma once - - -OPENMPT_NAMESPACE_BEGIN - - -// Standard IFF chunks IDs -#define IFFID_FORM 0x4d524f46 -#define IFFID_RIFF 0x46464952 -#define IFFID_WAVE 0x45564157 -#define IFFID_LIST 0x5453494C -#define IFFID_INFO 0x4F464E49 - -// IFF Info fields -#define IFFID_ICOP 0x504F4349 -#define IFFID_IART 0x54524149 -#define IFFID_IPRD 0x44525049 -#define IFFID_INAM 0x4D414E49 -#define IFFID_ICMT 0x544D4349 -#define IFFID_IENG 0x474E4549 -#define IFFID_ISFT 0x54465349 -#define IFFID_ISBJ 0x4A425349 -#define IFFID_IGNR 0x524E4749 -#define IFFID_ICRD 0x44524349 - -// Wave IFF chunks IDs -#define IFFID_wave 0x65766177 -#define IFFID_fmt 0x20746D66 -#define IFFID_wsmp 0x706D7377 -#define IFFID_data 0x61746164 - - -#ifdef NEEDS_PRAGMA_PACK -#pragma pack(push, 1) -#endif - -struct PACKED WAVEFILEHEADER -{ - DWORD id_RIFF; // "RIFF" - DWORD filesize; // file length-8 - DWORD id_WAVE; -}; - -STATIC_ASSERT(sizeof(WAVEFILEHEADER) == 12); - -struct PACKED WAVEDATAHEADER -{ - DWORD id_data; // "data" - DWORD length; // length of data -}; - -STATIC_ASSERT(sizeof(WAVEDATAHEADER) == 8); -#ifdef NEEDS_PRAGMA_PACK -#pragma pack(pop) -#endif - - -OPENMPT_NAMESPACE_END This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-01 22:12:00
|
Revision: 5230 http://sourceforge.net/p/modplug/code/5230 Author: saga-games Date: 2015-06-01 22:11:54 +0000 (Mon, 01 Jun 2015) Log Message: ----------- [Fix] Previous commit was still missing a file. [Imp] Make amplification and envelope scaling dialogs and use CNumberEdit Modified Paths: -------------- trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp trunk/OpenMPT/mptrack/SampleEditorDialogs.h trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/soundlib/Load_mid.cpp Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2015-06-01 22:00:39 UTC (rev 5229) +++ trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2015-06-01 22:11:54 UTC (rev 5230) @@ -29,7 +29,7 @@ //---------------------------------------------- { CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CSampleGridDlg) + //{{AFX_DATA_MAP(CAmpDlg) DDX_Control(pDX, IDC_COMBO1, m_fadeBox); //}}AFX_DATA_MAP } @@ -56,6 +56,9 @@ spin->SetPos32(m_nFactor); } SetDlgItemInt(IDC_EDIT1, m_nFactor); + m_edit.SubclassDlgItem(IDC_EDIT1, this); + m_edit.AllowFractions(false); + m_edit.AllowNegative(m_nFactorMin < 0); const struct { @@ -121,16 +124,12 @@ m_list.DeleteImageList(); } + void CAmpDlg::OnOK() //------------------ { - const int nVal = static_cast<int>(GetDlgItemInt(IDC_EDIT1)); - if(nVal < m_nFactorMin || nVal > m_nFactorMax) - { - CString str; str.Format(GetStrI18N(_T("Value should be within [%d, %d]")), m_nFactorMin, m_nFactorMax); - Reporting::Information(str); - return; - } + int nVal = static_cast<int>(GetDlgItemInt(IDC_EDIT1)); + Limit(nVal, m_nFactorMin, m_nFactorMax); m_nFactor = static_cast<int16>(nVal); m_bFadeIn = (IsDlgButtonChecked(IDC_CHECK1) != BST_UNCHECKED); m_bFadeOut = (IsDlgButtonChecked(IDC_CHECK2) != BST_UNCHECKED); @@ -173,7 +172,7 @@ CheckRadioButton(IDC_RADIO1, IDC_RADIO2, (m_nFormat.GetBitDepth() == 8) ? IDC_RADIO1 : IDC_RADIO2 ); CheckRadioButton(IDC_RADIO3, IDC_RADIO4, (m_nFormat.GetEncoding() == SampleIO::unsignedPCM) ? IDC_RADIO3 : IDC_RADIO4); CheckRadioButton(IDC_RADIO5, IDC_RADIO6, (m_nFormat.GetChannelFormat() == SampleIO::mono) ? IDC_RADIO5 : IDC_RADIO6); - CheckDlgButton(IDC_CHK_REMEMBERSETTINGS, (m_bRememberFormat) ? MF_CHECKED : MF_UNCHECKED); + CheckDlgButton(IDC_CHK_REMEMBERSETTINGS, (m_bRememberFormat ? MF_CHECKED : MF_UNCHECKED)); } Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.h =================================================================== --- trunk/OpenMPT/mptrack/SampleEditorDialogs.h 2015-06-01 22:00:39 UTC (rev 5229) +++ trunk/OpenMPT/mptrack/SampleEditorDialogs.h 2015-06-01 22:11:54 UTC (rev 5230) @@ -13,6 +13,7 @@ #include "../soundlib/SampleIO.h" #include "FadeLaws.h" +#include "CDecimalSupport.h" OPENMPT_NAMESPACE_BEGIN @@ -31,6 +32,7 @@ protected: CComboBoxEx m_fadeBox; CImageList m_list; + CNumberEdit m_edit; public: CAmpDlg(CWnd *parent, int16 factor, Fade::Law fadeLaw, int16 factorMin = int16_min, int16 factorMax = int16_max); Modified: trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp 2015-06-01 22:00:39 UTC (rev 5229) +++ trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp 2015-06-01 22:11:54 UTC (rev 5230) @@ -10,29 +10,28 @@ #include "stdafx.h" #include "resource.h" +#include "ModInstrument.h" #include "ScaleEnvPointsDlg.h" -#include "ModInstrument.h" OPENMPT_NAMESPACE_BEGIN -float CScaleEnvPointsDlg::m_fFactorX = 1.0f; -float CScaleEnvPointsDlg::m_fFactorY = 1.0f; +double CScaleEnvPointsDlg::m_fFactorX = 1.0; +double CScaleEnvPointsDlg::m_fFactorY = 1.0; BOOL CScaleEnvPointsDlg::OnInitDialog() //------------------------------------- { CDialog::OnInitDialog(); + m_EditX.SubclassDlgItem(IDC_EDIT_FACTORX, this); + m_EditY.SubclassDlgItem(IDC_EDIT_FACTORY, this); + m_EditX.AllowNegative(false); + m_EditX.SetDecimalValue(m_fFactorX); + m_EditY.SetDecimalValue(m_fFactorY); + m_EditX.SetFocus(); - char buffer[10]; - _snprintf(buffer, 9, "%g", m_fFactorX); - SetDlgItemText(IDC_EDIT_FACTORX, buffer); - _snprintf(buffer, 9, "%g", m_fFactorY); - SetDlgItemText(IDC_EDIT_FACTORY, buffer); - GetDlgItem(IDC_EDIT_FACTORX)->SetFocus(); - return FALSE; // return TRUE unless you set the focus to a control } @@ -40,18 +39,14 @@ void CScaleEnvPointsDlg::OnOK() //----------------------------- { - char buffer[10]; - GetDlgItemText(IDC_EDIT_FACTORX, buffer, 9); - m_fFactorX = ConvertStrTo<float>(buffer); + m_EditX.GetDecimalValue(m_fFactorX); + m_EditY.GetDecimalValue(m_fFactorY); - GetDlgItemText(IDC_EDIT_FACTORY, buffer, 9); - m_fFactorY = ConvertStrTo<float>(buffer); - if(m_fFactorX > 0 && m_fFactorX != 1) { for(uint32 i = 0; i < m_Env.nNodes; i++) { - m_Env.Ticks[i] = static_cast<WORD>(m_fFactorX * m_Env.Ticks[i]); + m_Env.Ticks[i] = static_cast<uint16>(m_fFactorX * m_Env.Ticks[i]); // Checking that the order of points is preserved. if(i > 0 && m_Env.Ticks[i] <= m_Env.Ticks[i - 1]) @@ -61,7 +56,7 @@ if(m_fFactorY != 1) { - float factor = m_fFactorY; + double factor = m_fFactorY; bool invert = false; if(m_fFactorY < 0) { Modified: trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.h =================================================================== --- trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.h 2015-06-01 22:00:39 UTC (rev 5229) +++ trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.h 2015-06-01 22:11:54 UTC (rev 5230) @@ -10,6 +10,8 @@ #pragma once +#include "CDecimalSupport.h" + OPENMPT_NAMESPACE_BEGIN struct InstrumentEnvelope; @@ -18,18 +20,19 @@ class CScaleEnvPointsDlg : public CDialog //======================================= { -public: - - CScaleEnvPointsDlg(CWnd* pParent, InstrumentEnvelope &env, int nCenter) : CDialog(IDD_SCALE_ENV_POINTS, pParent), m_Env(env) - { - m_nCenter = nCenter; - } - -private: +protected: + CNumberEdit m_EditX, m_EditY; InstrumentEnvelope &m_Env; //To tell which envelope to process. - static float m_fFactorX, m_fFactorY; + static double m_fFactorX, m_fFactorY; int m_nCenter; +public: + CScaleEnvPointsDlg(CWnd* pParent, InstrumentEnvelope &env, int nCenter) + : CDialog(IDD_SCALE_ENV_POINTS, pParent) + , m_Env(env) + , m_nCenter(nCenter) + { } + protected: virtual void OnOK(); virtual BOOL OnInitDialog(); Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2015-06-01 22:00:39 UTC (rev 5229) +++ trunk/OpenMPT/mptrack/mptrack.rc 2015-06-01 22:11:54 UTC (rev 5230) @@ -1106,11 +1106,12 @@ CONTROL "Plugin volume command &bug emulation",IDC_CHK_MIDICCBUG, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,167,222,12 LTEXT "&Tempo Mode:",IDC_TEXT_TEMPOMODE,12,204,44,8 - COMBOBOX IDC_COMBO_TEMPOMODE,12,215,108,77,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Rows per beat",IDC_TEXT_ROWSPERBEAT,162,206,84,8 - EDITTEXT IDC_ROWSPERBEAT,132,204,24,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Rows per measure",IDC_TEXT_ROWSPERMEASURE,162,223,84,8 - EDITTEXT IDC_ROWSPERMEASURE,132,222,24,12,ES_AUTOHSCROLL | ES_NUMBER + COMBOBOX IDC_COMBO_TEMPOMODE,60,204,78,77,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Rows per beat",IDC_TEXT_ROWSPERBEAT,174,206,72,8 + EDITTEXT IDC_ROWSPERBEAT,144,204,24,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Rows per measure",IDC_TEXT_ROWSPERMEASURE,174,223,72,8 + EDITTEXT IDC_ROWSPERMEASURE,144,222,24,12,ES_AUTOHSCROLL | ES_NUMBER + PUSHBUTTON "Configure S&huffle",IDC_BUTTON1,60,222,78,12 RTEXT "Created with:",IDC_TEXT_CREATEDWITH,12,260,60,8 EDITTEXT IDC_EDIT_CREATEDWITH,78,258,166,13,ES_AUTOHSCROLL | ES_READONLY,WS_EX_STATICEDGE RTEXT "Last saved with:",IDC_TEXT_SAVEDWITH,12,276,60,8 @@ -1339,7 +1340,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN LTEXT "Amplify by",IDC_STATIC,13,21,37,8 - EDITTEXT IDC_EDIT1,60,18,40,14,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT1,60,18,40,14,ES_AUTOHSCROLL | ES_NUMBER CONTROL "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,95,19,11,14 LTEXT "%",IDC_STATIC,103,21,11,8 DEFPUSHBUTTON "OK",IDOK,150,6,50,14 @@ -2738,8 +2739,8 @@ CAPTION "Scale Envelope Points" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - EDITTEXT IDC_EDIT_FACTORX,126,6,36,13,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_FACTORY,126,24,36,13,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FACTORX,126,6,36,13,ES_AUTOHSCROLL | ES_NUMBER + EDITTEXT IDC_EDIT_FACTORY,126,24,36,13,ES_AUTOHSCROLL | ES_NUMBER DEFPUSHBUTTON "OK",IDOK,60,54,50,14 PUSHBUTTON "Cancel",IDCANCEL,114,54,50,14 LTEXT "Scale envelope points (x axis) by:",IDC_STATIC,6,8,120,8 Modified: trunk/OpenMPT/soundlib/Load_mid.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mid.cpp 2015-06-01 22:00:39 UTC (rev 5229) +++ trunk/OpenMPT/soundlib/Load_mid.cpp 2015-06-01 22:11:54 UTC (rev 5230) @@ -12,7 +12,6 @@ #include "stdafx.h" #include "Loaders.h" #include "Dlsbank.h" -#include "Wav.h" #ifdef MODPLUG_TRACKER #include "../mptrack/TrackerSettings.h" #endif // MODPLUG_TRACKER This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-06-02 10:21:47
|
Revision: 5233 http://sourceforge.net/p/modplug/code/5233 Author: manxorist Date: 2015-06-02 10:21:40 +0000 (Tue, 02 Jun 2015) Log Message: ----------- [Ref] Tuning: The one single builtin tuning (standard 12TET) can easily be created from scratch using the CTuning interface. There is no need to load it from a resource or bin2h data. Additionally, there is no global tuning dialog in OpenMPT which means that tuning data can only ever be viewed/accessed via an open module, which makes it easy to move the one builtin tuning from global data to CSoundFile member data (i.e. the very same thing libopenmpt has always done). The memory overhead and construction cost is negligable compared to CSoundFile as a whole, thus, in order to keep things simple, the tuning is always contructed (as in libopenmpt) even if only strictly required for MPTM files. The created builtin tuning is verified to be identical to the old serialized data via a test cast. This is a small first step towards converting the custom tuning handling to the same style as patterns, samples and instruments are handled (i.e. strictly per module, in order to make modules easily portable). There are no user visible changes. Modified Paths: -------------- trunk/OpenMPT/build/autotools/Makefile.am trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/test/test.cpp Removed Paths: ------------- trunk/OpenMPT/soundlib/Tunings/ Modified: trunk/OpenMPT/build/autotools/Makefile.am =================================================================== --- trunk/OpenMPT/build/autotools/Makefile.am 2015-06-02 08:57:02 UTC (rev 5232) +++ trunk/OpenMPT/build/autotools/Makefile.am 2015-06-02 10:21:40 UTC (rev 5233) @@ -224,7 +224,6 @@ libopenmpt_la_SOURCES += soundlib/XMTools.cpp libopenmpt_la_SOURCES += soundlib/XMTools.h libopenmpt_la_SOURCES += soundlib/plugins/PlugInterface.h -libopenmpt_la_SOURCES += soundlib/Tunings/built-inTunings.h libopenmpt_la_SOURCES += libopenmpt/libopenmpt_c.cpp libopenmpt_la_SOURCES += libopenmpt/libopenmpt_cxx.cpp libopenmpt_la_SOURCES += libopenmpt/libopenmpt_ext.cpp @@ -427,7 +426,6 @@ libopenmpttest_SOURCES += soundlib/XMTools.cpp libopenmpttest_SOURCES += soundlib/XMTools.h libopenmpttest_SOURCES += soundlib/plugins/PlugInterface.h -libopenmpttest_SOURCES += soundlib/Tunings/built-inTunings.h libopenmpttest_SOURCES += libopenmpt/libopenmpt_c.cpp libopenmpttest_SOURCES += libopenmpt/libopenmpt_cxx.cpp libopenmpttest_SOURCES += libopenmpt/libopenmpt_ext.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2015-06-02 08:57:02 UTC (rev 5232) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2015-06-02 10:21:40 UTC (rev 5233) @@ -2549,11 +2549,11 @@ sel -= 1; CTuningCollection* tc = 0; - if(sel < CSoundFile::GetBuiltInTunings().GetNumTunings()) - tc = &CSoundFile::GetBuiltInTunings(); + if(sel < m_sndFile.GetBuiltInTunings().GetNumTunings()) + tc = &m_sndFile.GetBuiltInTunings(); else { - sel -= CSoundFile::GetBuiltInTunings().GetNumTunings(); + sel -= m_sndFile.GetBuiltInTunings().GetNumTunings(); if(sel < CSoundFile::GetLocalTunings().GetNumTunings()) tc = &CSoundFile::GetLocalTunings(); else @@ -2613,9 +2613,9 @@ return; } - for(size_t i = 0; i < CSoundFile::GetBuiltInTunings().GetNumTunings(); i++) + for(size_t i = 0; i < m_sndFile.GetBuiltInTunings().GetNumTunings(); i++) { - if(pIns->pTuning == &CSoundFile::GetBuiltInTunings().GetTuning(i)) + if(pIns->pTuning == &m_sndFile.GetBuiltInTunings().GetTuning(i)) { m_ComboTuning.SetCurSel((int)(i + 1)); return; @@ -2626,7 +2626,7 @@ { if(pIns->pTuning == &CSoundFile::GetLocalTunings().GetTuning(i)) { - m_ComboTuning.SetCurSel((int)(i + CSoundFile::GetBuiltInTunings().GetNumTunings() + 1)); + m_ComboTuning.SetCurSel((int)(i + m_sndFile.GetBuiltInTunings().GetNumTunings() + 1)); return; } } @@ -2635,7 +2635,7 @@ { if(pIns->pTuning == &m_sndFile.GetTuneSpecificTunings().GetTuning(i)) { - m_ComboTuning.SetCurSel((int)(i + CSoundFile::GetBuiltInTunings().GetNumTunings() + CSoundFile::GetLocalTunings().GetNumTunings() + 1)); + m_ComboTuning.SetCurSel((int)(i + m_sndFile.GetBuiltInTunings().GetNumTunings() + CSoundFile::GetLocalTunings().GetNumTunings() + 1)); return; } } @@ -2829,9 +2829,9 @@ m_ComboTuning.ResetContent(); m_ComboTuning.AddString("OMPT IT behavior"); //<-> Instrument pTuning pointer == NULL - for(size_t i = 0; i<CSoundFile::GetBuiltInTunings().GetNumTunings(); i++) + for(size_t i = 0; i<m_sndFile.GetBuiltInTunings().GetNumTunings(); i++) { - m_ComboTuning.AddString(CSoundFile::GetBuiltInTunings().GetTuning(i).GetName().c_str()); + m_ComboTuning.AddString(m_sndFile.GetBuiltInTunings().GetTuning(i).GetName().c_str()); } for(size_t i = 0; i<CSoundFile::GetLocalTunings().GetNumTunings(); i++) { Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2015-06-02 08:57:02 UTC (rev 5232) +++ trunk/OpenMPT/mptrack/mptrack.rc 2015-06-02 10:21:40 UTC (rev 5233) @@ -2909,12 +2909,6 @@ IDR_DEFAULT_KEYBINDINGS KEYBINDINGS "res\\defaultKeybindings.mkb" -///////////////////////////////////////////////////////////////////////////// -// -// TUNING -// - -IDR_BUILTIN_TUNINGS TUNING "..\\soundlib\\Tunings\\built-inTunings.tc" #endif // English (United Kingdom) resources ///////////////////////////////////////////////////////////////////////////// Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2015-06-02 08:57:02 UTC (rev 5232) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2015-06-02 10:21:40 UTC (rev 5233) @@ -1130,7 +1130,6 @@ <ClInclude Include="WelcomeDialog.h" /> </ItemGroup> <ItemGroup> - <None Include="..\soundlib\Tunings\built-inTunings.tc" /> <None Include="res\bitmap1.bmp" /> <None Include="res\colors.bmp" /> <None Include="res\dragging.cur" /> Modified: trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2015-06-02 08:57:02 UTC (rev 5232) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters 2015-06-02 10:21:40 UTC (rev 5233) @@ -1169,9 +1169,6 @@ <None Include="res\vispcnode.bmp"> <Filter>Resource Files</Filter> </None> - <None Include="..\soundlib\Tunings\built-inTunings.tc"> - <Filter>Resource Files</Filter> - </None> <None Include="res\envelope_toolbar.png"> <Filter>Resource Files</Filter> </None> Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2015-06-02 08:57:02 UTC (rev 5232) +++ trunk/OpenMPT/mptrack/resource.h 2015-06-02 10:21:40 UTC (rev 5233) @@ -114,7 +114,6 @@ #define IDD_MSGBOX_HIDABLE 516 #define IDD_ADDSILENCE 517 #define IDR_DEFAULT_KEYBINDINGS 519 -#define IDR_BUILTIN_TUNINGS 520 #define IDD_CLEANUP_SONG 521 #define IDD_CHANNELSETTINGS 522 #define IDD_KEYBOARD_SPLIT 523 Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2015-06-02 08:57:02 UTC (rev 5232) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2015-06-02 10:21:40 UTC (rev 5233) @@ -67,7 +67,6 @@ // CSoundFile #ifdef MODPLUG_TRACKER -CTuningCollection* CSoundFile::s_pTuningsSharedBuiltIn(0); CTuningCollection* CSoundFile::s_pTuningsSharedLocal(0); #endif @@ -134,10 +133,7 @@ m_PlayState.m_lTotalSampleCount = 0; m_PlayState.m_bPositionChanged = true; -#ifndef MODPLUG_TRACKER - m_pTuningsBuiltIn = new CTuningCollection(); LoadBuiltInTunings(); -#endif m_pTuningsTuneSpecific = new CTuningCollection("Tune specific tunings"); } @@ -148,10 +144,7 @@ Destroy(); delete m_pTuningsTuneSpecific; m_pTuningsTuneSpecific = nullptr; -#ifndef MODPLUG_TRACKER - delete m_pTuningsBuiltIn; - m_pTuningsBuiltIn = nullptr; -#endif + UnloadBuiltInTunings(); } @@ -1126,7 +1119,6 @@ //--------------------------------- { delete s_pTuningsSharedLocal; s_pTuningsSharedLocal = nullptr; - delete s_pTuningsSharedBuiltIn; s_pTuningsSharedBuiltIn = nullptr; } #endif @@ -1149,32 +1141,12 @@ bool CSoundFile::LoadStaticTunings() //---------------------------------- { - if(s_pTuningsSharedLocal || s_pTuningsSharedBuiltIn) return true; + if(s_pTuningsSharedLocal) return true; //For now not allowing to reload tunings(one should be careful when reloading them //since various parts may use addresses of the tuningobjects). - s_pTuningsSharedBuiltIn = new CTuningCollection; s_pTuningsSharedLocal = new CTuningCollection("Local tunings"); - // Load built-in tunings. - const char* pData = nullptr; - HGLOBAL hglob = nullptr; - size_t nSize = 0; - if (LoadResource(MAKEINTRESOURCE(IDR_BUILTIN_TUNINGS), TEXT("TUNING"), pData, nSize, hglob) != nullptr) - { - std::istringstream iStrm(std::string(pData, nSize)); - s_pTuningsSharedBuiltIn->Deserialize(iStrm); - } - if(s_pTuningsSharedBuiltIn->GetNumTunings() == 0) - { - MPT_ASSERT(false); - CTuningRTI* pT = new CTuningRTI; - //Note: Tuning collection class handles deleting. - pT->CreateGeometric(1,1); - if(s_pTuningsSharedBuiltIn->AddTuning(pT)) - delete pT; - } - // Load local tunings. s_pTuningsSharedLocal->SetSavefilePath( TrackerSettings::Instance().PathTunings.GetDefaultDir() @@ -1183,28 +1155,37 @@ ); s_pTuningsSharedLocal->Deserialize(); - // Enabling adding/removing of tunings for standard collection - // only for debug builds. - #ifdef DEBUG - s_pTuningsSharedBuiltIn->SetConstStatus(CTuningCollection::EM_ALLOWALL); - #else - s_pTuningsSharedBuiltIn->SetConstStatus(CTuningCollection::EM_CONST); - #endif - return false; } -#else -#include "Tunings/built-inTunings.h" +#endif + + void CSoundFile::LoadBuiltInTunings() //----------------------------------- { - std::string data(built_inTunings_tc_data, built_inTunings_tc_data + built_inTunings_tc_size); - std::istringstream iStrm(data); - m_pTuningsBuiltIn->Deserialize(iStrm); + m_pTuningsBuiltIn = new CTuningCollection("Built-in tunings"); + CTuningRTI* pT = new CTuningRTI; + pT->SetName("12TET [[fs15 1.17.02.49]]"); + pT->CreateGeometric(12, 2); + pT->SetFineStepCount(15); + for(ModCommand::NOTE note = NOTE_MIDDLEC; note < NOTE_MIDDLEC + 12; ++note) + { + pT->SetNoteName(note - NOTE_MIDDLEC, GetNoteName(note).substr(0, 2)); + } + pT->SetEditMask(CTuningBase::EM_CONST_STRICT); + // Note: Tuning collection class handles deleting. + m_pTuningsBuiltIn->AddTuning(pT); } -#endif +void CSoundFile::UnloadBuiltInTunings() +//------------------------------------- +{ + delete m_pTuningsBuiltIn; + m_pTuningsBuiltIn = nullptr; +} + + std::string CSoundFile::GetNoteName(const ModCommand::NOTE note, const INSTRUMENTINDEX inst) const //------------------------------------------------------------------------------------------------ { Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2015-06-02 08:57:02 UTC (rev 5232) +++ trunk/OpenMPT/soundlib/Sndfile.h 2015-06-02 10:21:40 UTC (rev 5233) @@ -320,12 +320,11 @@ static bool LoadStaticTunings(); bool SaveStaticTunings(); static void DeleteStaticdata(); - static CTuningCollection& GetBuiltInTunings() {return *s_pTuningsSharedBuiltIn;} static CTuningCollection& GetLocalTunings() {return *s_pTuningsSharedLocal;} -#else +#endif void LoadBuiltInTunings(); + void UnloadBuiltInTunings(); CTuningCollection& GetBuiltInTunings() {return *m_pTuningsBuiltIn;} -#endif static CTuning *GetDefaultTuning() {return nullptr;} CTuningCollection& GetTuneSpecificTunings() {return *m_pTuningsTuneSpecific;} @@ -334,11 +333,9 @@ private: CTuningCollection* m_pTuningsTuneSpecific; #ifdef MODPLUG_TRACKER - static CTuningCollection* s_pTuningsSharedBuiltIn; static CTuningCollection* s_pTuningsSharedLocal; -#else +#endif CTuningCollection* m_pTuningsBuiltIn; -#endif //<--Tuning public: // get 'controllers' Modified: trunk/OpenMPT/test/test.cpp =================================================================== --- trunk/OpenMPT/test/test.cpp 2015-06-02 08:57:02 UTC (rev 5232) +++ trunk/OpenMPT/test/test.cpp 2015-06-02 10:21:40 UTC (rev 5233) @@ -26,6 +26,8 @@ #include "../soundlib/MIDIMacros.h" #include "../soundlib/SampleFormatConverters.h" #include "../soundlib/ITCompression.h" +#include "../soundlib/tuningcollection.h" +#include "../soundlib/tuning.h" #ifdef MODPLUG_TRACKER #include "../mptrack/mptrack.h" #include "../mptrack/moddoc.h" @@ -75,6 +77,7 @@ static MPT_NOINLINE void TestMIDIEvents(); static MPT_NOINLINE void TestSampleConversion(); static MPT_NOINLINE void TestITCompression(); +static MPT_NOINLINE void TestTunings(); static MPT_NOINLINE void TestPCnoteSerialization(); static MPT_NOINLINE void TestLoadSaveFile(); @@ -138,6 +141,7 @@ DO_TEST(TestMIDIEvents); DO_TEST(TestSampleConversion); DO_TEST(TestITCompression); + DO_TEST(TestTunings); // slower tests, require opening a CModDoc DO_TEST(TestPCnoteSerialization); @@ -2108,6 +2112,110 @@ } + +static bool RatioEqual(CTuningBase::RATIOTYPE a, CTuningBase::RATIOTYPE b) +//------------------------------------------------------------------------ +{ + if(a == CTuningBase::RATIOTYPE(0) && b == CTuningBase::RATIOTYPE(0)) + { + return true; + } + if(a == CTuningBase::RATIOTYPE(0) || b == CTuningBase::RATIOTYPE(0)) + { + return false; + } + return (std::fabs(CTuningBase::RATIOTYPE(1) - (a/b)) < CTuningBase::RATIOTYPE(0.0001)); +} + + +static void CheckEualTuningCollections(const CTuningCollection &a, const CTuningCollection &b) +//-------------------------------------------------------------------------------------------- +{ + VERIFY_EQUAL(a.GetName(), b.GetName()); + VERIFY_EQUAL(a.GetNumTunings(), b.GetNumTunings()); + for(std::size_t tuning = 0; tuning < std::min(a.GetNumTunings(), b.GetNumTunings()); ++tuning) + { + VERIFY_EQUAL(a.GetTuning(tuning).GetName(), b.GetTuning(tuning).GetName()); + VERIFY_EQUAL(a.GetTuning(tuning).GetTuningType(), b.GetTuning(tuning).GetTuningType()); + VERIFY_EQUAL(a.GetTuning(tuning).GetGroupSize(), b.GetTuning(tuning).GetGroupSize()); + VERIFY_EQUAL(a.GetTuning(tuning).GetFineStepCount(), b.GetTuning(tuning).GetFineStepCount()); + VERIFY_EQUAL(RatioEqual(a.GetTuning(tuning).GetGroupRatio(), b.GetTuning(tuning).GetGroupRatio()), true); + VERIFY_EQUAL(a.GetTuning(tuning).GetValidityRange(), b.GetTuning(tuning).GetValidityRange()); + for(ModCommand::NOTE note = NOTE_MIN; note <= NOTE_MAX; ++note) + { + VERIFY_EQUAL(a.GetTuning(tuning).GetNoteName(note - NOTE_MIDDLEC), b.GetTuning(tuning).GetNoteName(note - NOTE_MIDDLEC)); + VERIFY_EQUAL(RatioEqual(a.GetTuning(tuning).GetRatio(note - NOTE_MIDDLEC), b.GetTuning(tuning).GetRatio(note - NOTE_MIDDLEC)), true); + } + } +} + + +static MPT_NOINLINE void TestTunings() +//------------------------------------ +{ + + // check that the generated builtin tunings match the old resource data + + CSoundFile *emptyFile = new CSoundFile(); + emptyFile->Create(FileReader()); + + static const size_t built_inTunings_tc_size = 244; + static const unsigned char built_inTunings_tc_data[244]= + { + 0x32,0x32,0x38,0x02,0x54,0x43,0x1F,0x08,0x00,0x01,0x0C, + 0x01,0x0D,0x00,0x9F,0x03,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x42,0x75,0x69,0x6C,0x74,0x2D,0x69,0x6E,0x20,0x74, + 0x75,0x6E,0x69,0x6E,0x67,0x73,0xFF,0xFF,0x32,0x32,0x38, + 0x09,0x43,0x54,0x42,0x32,0x34,0x34,0x52,0x54,0x49,0x1F, + 0x08,0x00,0x01,0x12,0x00,0x00,0x10,0x01,0x25,0x00,0x27, + 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x31,0x32,0x54, + 0x45,0x54,0x20,0x5B,0x5B,0x66,0x73,0x31,0x35,0x20,0x31, + 0x2E,0x31,0x37,0x2E,0x30,0x32,0x2E,0x34,0x39,0x5D,0x5D, + 0x00,0x00,0x03,0x00,0x30,0x00,0x00,0x02,0x43,0x2D,0x01, + 0x00,0x02,0x43,0x23,0x02,0x00,0x02,0x44,0x2D,0x03,0x00, + 0x02,0x44,0x23,0x04,0x00,0x02,0x45,0x2D,0x05,0x00,0x02, + 0x46,0x2D,0x06,0x00,0x02,0x46,0x23,0x07,0x00,0x02,0x47, + 0x2D,0x08,0x00,0x02,0x47,0x23,0x09,0x00,0x02,0x41,0x2D, + 0x0A,0x00,0x02,0x41,0x23,0x0B,0x00,0x02,0x42,0x2D,0x0F, + 0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x0C,0x00,0x80,0x00, + 0xC0,0xFF,0x02,0x30,0x80,0x68,0x02,0x31,0xE8,0x08,0x02, + 0x32,0xF0,0x08,0x02,0x33,0xF8,0xF4,0x02,0x34,0xED,0x01, + 0x10,0x08,0x52,0x54,0x49,0x33,0xFD,0x01,0x10,0x08,0x52, + 0x54,0x49,0x32,0x0D,0x02,0x08,0x08,0x52,0x54,0x49,0x34, + 0x15,0x02,0x08,0x08,0x52,0x54,0x49,0x31,0x1D,0x02,0x08, + 0x02,0x30,0x58,0x44,0x02,0x31,0x9C,0x08,0x02,0x32,0xA4, + 0xF9,0x02 + }; + CTuningCollection *oldBuiltin = new CTuningCollection(); + std::string builtindata(built_inTunings_tc_data, built_inTunings_tc_data + built_inTunings_tc_size); + std::istringstream iStrm(builtindata); + oldBuiltin->Deserialize(iStrm); + + CheckEualTuningCollections(emptyFile->GetBuiltInTunings(), *oldBuiltin); + +#if MPT_COMPILER_MSVC + + // Test that the serialization exactly matches the old data. + // This depends on exactly identical floating point representations (and thus rounding), which is why we limit this test to MSVC. + + std::ostringstream stream; + stream.imbue(std::locale::classic()); + emptyFile->GetBuiltInTunings().Serialize(stream); + std::string str = stream.str(); + std::vector<char> data = std::vector<char>(str.data(), str.data() + str.size()); + + VERIFY_EQUAL(data, std::vector<char>(built_inTunings_tc_data, built_inTunings_tc_data + built_inTunings_tc_size)); + +#endif + + delete oldBuiltin; + + emptyFile->Destroy(); + delete emptyFile; +} + + + static double Rand01() {return rand() / double(RAND_MAX);} template <class T> T Rand(const T min, const T max) {return Util::Round<T>(min + Rand01() * (max - min));} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-06-02 14:03:44
|
Revision: 5236 http://sourceforge.net/p/modplug/code/5236 Author: manxorist Date: 2015-06-02 14:03:30 +0000 (Tue, 02 Jun 2015) Log Message: ----------- [Ref] Split mptCPU, mptOS, mptLibrary, mptUUID and mptTime from misc_utils. misc_utils.h still includes all those. Includes can be cleaned up later. Modified Paths: -------------- trunk/OpenMPT/build/android_ndk/Android-unmo3.mk trunk/OpenMPT/build/android_ndk/Android.mk trunk/OpenMPT/build/autotools/Makefile.am trunk/OpenMPT/build/vs2008/OpenMPT.vcproj trunk/OpenMPT/build/vs2008/libopenmpt.vcproj trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj.filters trunk/OpenMPT/common/misc_util.cpp trunk/OpenMPT/common/misc_util.h trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters Added Paths: ----------- trunk/OpenMPT/common/mptCPU.cpp trunk/OpenMPT/common/mptCPU.h trunk/OpenMPT/common/mptLibrary.cpp trunk/OpenMPT/common/mptLibrary.h trunk/OpenMPT/common/mptOS.cpp trunk/OpenMPT/common/mptOS.h trunk/OpenMPT/common/mptTime.cpp trunk/OpenMPT/common/mptTime.h trunk/OpenMPT/common/mptUUID.cpp trunk/OpenMPT/common/mptUUID.h Modified: trunk/OpenMPT/build/android_ndk/Android-unmo3.mk =================================================================== --- trunk/OpenMPT/build/android_ndk/Android-unmo3.mk 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/android_ndk/Android-unmo3.mk 2015-06-02 14:03:30 UTC (rev 5236) @@ -53,10 +53,15 @@ common/ComponentManager.cpp \ common/Logging.cpp \ common/misc_util.cpp \ + common/mptCPU.cpp \ common/mptFileIO.cpp \ common/mptIO.cpp \ + common/mptLibrary.cpp \ + common/mptOS.cpp \ common/mptPathString.cpp \ common/mptString.cpp \ + common/mptTime.cpp \ + common/mptUUID.cpp \ common/Profiler.cpp \ common/serialization_utils.cpp \ common/typedefs.cpp \ Modified: trunk/OpenMPT/build/android_ndk/Android.mk =================================================================== --- trunk/OpenMPT/build/android_ndk/Android.mk 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/android_ndk/Android.mk 2015-06-02 14:03:30 UTC (rev 5236) @@ -21,10 +21,15 @@ common/ComponentManager.cpp \ common/Logging.cpp \ common/misc_util.cpp \ + common/mptCPU.cpp \ common/mptFileIO.cpp \ common/mptIO.cpp \ + common/mptLibrary.cpp \ + common/mptOS.cpp \ common/mptPathString.cpp \ common/mptString.cpp \ + common/mptTime.cpp \ + common/mptUUID.cpp \ common/Profiler.cpp \ common/serialization_utils.cpp \ common/typedefs.cpp \ Modified: trunk/OpenMPT/build/autotools/Makefile.am =================================================================== --- trunk/OpenMPT/build/autotools/Makefile.am 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/autotools/Makefile.am 2015-06-02 14:03:30 UTC (rev 5236) @@ -90,14 +90,24 @@ libopenmpt_la_SOURCES += common/misc_util.cpp libopenmpt_la_SOURCES += common/misc_util.h libopenmpt_la_SOURCES += common/mptAtomic.h +libopenmpt_la_SOURCES += common/mptCPU.cpp +libopenmpt_la_SOURCES += common/mptCPU.h libopenmpt_la_SOURCES += common/mptFileIO.cpp libopenmpt_la_SOURCES += common/mptFileIO.h libopenmpt_la_SOURCES += common/mptIO.cpp libopenmpt_la_SOURCES += common/mptIO.h +libopenmpt_la_SOURCES += common/mptLibrary.cpp +libopenmpt_la_SOURCES += common/mptLibrary.h +libopenmpt_la_SOURCES += common/mptOS.cpp +libopenmpt_la_SOURCES += common/mptOS.h libopenmpt_la_SOURCES += common/mptPathString.cpp libopenmpt_la_SOURCES += common/mptPathString.h libopenmpt_la_SOURCES += common/mptString.cpp libopenmpt_la_SOURCES += common/mptString.h +libopenmpt_la_SOURCES += common/mptTime.cpp +libopenmpt_la_SOURCES += common/mptTime.h +libopenmpt_la_SOURCES += common/mptUUID.cpp +libopenmpt_la_SOURCES += common/mptUUID.h libopenmpt_la_SOURCES += common/mutex.h libopenmpt_la_SOURCES += common/Profiler.cpp libopenmpt_la_SOURCES += common/Profiler.h @@ -292,14 +302,24 @@ libopenmpttest_SOURCES += common/misc_util.cpp libopenmpttest_SOURCES += common/misc_util.h libopenmpttest_SOURCES += common/mptAtomic.h +libopenmpttest_SOURCES += common/mptCPU.cpp +libopenmpttest_SOURCES += common/mptCPU.h libopenmpttest_SOURCES += common/mptFileIO.cpp libopenmpttest_SOURCES += common/mptFileIO.h libopenmpttest_SOURCES += common/mptIO.cpp libopenmpttest_SOURCES += common/mptIO.h +libopenmpttest_SOURCES += common/mptLibrary.cpp +libopenmpttest_SOURCES += common/mptLibrary.h +libopenmpttest_SOURCES += common/mptOS.cpp +libopenmpttest_SOURCES += common/mptOS.h libopenmpttest_SOURCES += common/mptPathString.cpp libopenmpttest_SOURCES += common/mptPathString.h libopenmpttest_SOURCES += common/mptString.cpp libopenmpttest_SOURCES += common/mptString.h +libopenmpttest_SOURCES += common/mptTime.cpp +libopenmpttest_SOURCES += common/mptTime.h +libopenmpttest_SOURCES += common/mptUUID.cpp +libopenmpttest_SOURCES += common/mptUUID.h libopenmpttest_SOURCES += common/mutex.h libopenmpttest_SOURCES += common/Profiler.cpp libopenmpttest_SOURCES += common/Profiler.h Modified: trunk/OpenMPT/build/vs2008/OpenMPT.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/OpenMPT.vcproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2008/OpenMPT.vcproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -660,6 +660,14 @@ > </File> <File + RelativePath="..\..\common\mptCPU.cpp" + > + </File> + <File + RelativePath="..\..\common\mptCPU.h" + > + </File> + <File RelativePath="..\..\common\mptFileIO.cpp" > </File> @@ -676,6 +684,22 @@ > </File> <File + RelativePath="..\..\common\mptLibrary.cpp" + > + </File> + <File + RelativePath="..\..\common\mptLibrary.h" + > + </File> + <File + RelativePath="..\..\common\mptOS.cpp" + > + </File> + <File + RelativePath="..\..\common\mptOS.h" + > + </File> + <File RelativePath="..\..\common\mptPathString.cpp" > </File> @@ -692,6 +716,22 @@ > </File> <File + RelativePath="..\..\common\mptTime.cpp" + > + </File> + <File + RelativePath="..\..\common\mptTime.h" + > + </File> + <File + RelativePath="..\..\common\mptUUID.cpp" + > + </File> + <File + RelativePath="..\..\common\mptUUID.h" + > + </File> + <File RelativePath="..\..\common\mutex.h" > </File> Modified: trunk/OpenMPT/build/vs2008/libopenmpt.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/libopenmpt.vcproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2008/libopenmpt.vcproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -375,6 +375,14 @@ > </File> <File + RelativePath="..\..\common\mptCPU.cpp" + > + </File> + <File + RelativePath="..\..\common\mptCPU.h" + > + </File> + <File RelativePath="..\..\common\mptFileIO.cpp" > </File> @@ -391,6 +399,22 @@ > </File> <File + RelativePath="..\..\common\mptLibrary.cpp" + > + </File> + <File + RelativePath="..\..\common\mptLibrary.h" + > + </File> + <File + RelativePath="..\..\common\mptOS.cpp" + > + </File> + <File + RelativePath="..\..\common\mptOS.h" + > + </File> + <File RelativePath="..\..\common\mptPathString.cpp" > </File> @@ -407,6 +431,22 @@ > </File> <File + RelativePath="..\..\common\mptTime.cpp" + > + </File> + <File + RelativePath="..\..\common\mptTime.h" + > + </File> + <File + RelativePath="..\..\common\mptUUID.cpp" + > + </File> + <File + RelativePath="..\..\common\mptUUID.h" + > + </File> + <File RelativePath="..\..\common\mutex.h" > </File> Modified: trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -423,6 +423,14 @@ > </File> <File + RelativePath="..\..\common\mptCPU.cpp" + > + </File> + <File + RelativePath="..\..\common\mptCPU.h" + > + </File> + <File RelativePath="..\..\common\mptFileIO.cpp" > </File> @@ -439,6 +447,22 @@ > </File> <File + RelativePath="..\..\common\mptLibrary.cpp" + > + </File> + <File + RelativePath="..\..\common\mptLibrary.h" + > + </File> + <File + RelativePath="..\..\common\mptOS.cpp" + > + </File> + <File + RelativePath="..\..\common\mptOS.h" + > + </File> + <File RelativePath="..\..\common\mptPathString.cpp" > </File> @@ -455,6 +479,22 @@ > </File> <File + RelativePath="..\..\common\mptTime.cpp" + > + </File> + <File + RelativePath="..\..\common\mptTime.h" + > + </File> + <File + RelativePath="..\..\common\mptUUID.cpp" + > + </File> + <File + RelativePath="..\..\common\mptUUID.h" + > + </File> + <File RelativePath="..\..\common\mutex.h" > </File> Modified: trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -419,6 +419,14 @@ > </File> <File + RelativePath="..\..\common\mptCPU.cpp" + > + </File> + <File + RelativePath="..\..\common\mptCPU.h" + > + </File> + <File RelativePath="..\..\common\mptFileIO.cpp" > </File> @@ -435,6 +443,22 @@ > </File> <File + RelativePath="..\..\common\mptLibrary.cpp" + > + </File> + <File + RelativePath="..\..\common\mptLibrary.h" + > + </File> + <File + RelativePath="..\..\common\mptOS.cpp" + > + </File> + <File + RelativePath="..\..\common\mptOS.h" + > + </File> + <File RelativePath="..\..\common\mptPathString.cpp" > </File> @@ -451,6 +475,22 @@ > </File> <File + RelativePath="..\..\common\mptTime.cpp" + > + </File> + <File + RelativePath="..\..\common\mptTime.h" + > + </File> + <File + RelativePath="..\..\common\mptUUID.cpp" + > + </File> + <File + RelativePath="..\..\common\mptUUID.h" + > + </File> + <File RelativePath="..\..\common\mutex.h" > </File> Modified: trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -360,10 +360,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -535,10 +540,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp"> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> Modified: trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -77,18 +77,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptCPU.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptFileIO.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptIO.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptLibrary.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptOS.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptPathString.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptTime.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptUUID.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mutex.h"> <Filter>common</Filter> </ClInclude> @@ -598,18 +613,33 @@ <ClCompile Include="..\..\common\misc_util.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptCPU.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptFileIO.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptIO.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptLibrary.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptOS.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptPathString.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptTime.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptUUID.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\serialization_utils.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -186,10 +186,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -255,10 +260,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp" /> <ClCompile Include="..\..\common\typedefs.cpp" /> Modified: trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -51,18 +51,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptCPU.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptFileIO.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptIO.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptLibrary.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptOS.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptPathString.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptTime.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptUUID.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mutex.h"> <Filter>common</Filter> </ClInclude> @@ -254,18 +269,33 @@ <ClCompile Include="..\..\common\misc_util.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptCPU.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptFileIO.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptIO.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptLibrary.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptOS.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptPathString.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptTime.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptUUID.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\serialization_utils.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -190,10 +190,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -259,10 +264,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp" /> <ClCompile Include="..\..\common\typedefs.cpp" /> Modified: trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -51,18 +51,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptCPU.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptFileIO.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptIO.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptLibrary.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptOS.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptPathString.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptTime.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptUUID.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mutex.h"> <Filter>common</Filter> </ClInclude> @@ -254,18 +269,33 @@ <ClCompile Include="..\..\common\misc_util.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptCPU.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptFileIO.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptIO.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptLibrary.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptOS.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptPathString.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptTime.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptUUID.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\serialization_utils.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -194,10 +194,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -267,10 +272,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp" /> <ClCompile Include="..\..\common\typedefs.cpp" /> Modified: trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -54,18 +54,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptCPU.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptFileIO.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptIO.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptLibrary.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptOS.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptPathString.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptTime.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptUUID.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mutex.h"> <Filter>common</Filter> </ClInclude> @@ -269,18 +284,33 @@ <ClCompile Include="..\..\common\misc_util.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptCPU.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptFileIO.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptIO.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptLibrary.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptOS.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptPathString.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptTime.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptUUID.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\serialization_utils.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -366,10 +366,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -541,10 +546,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp"> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> Modified: trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -77,18 +77,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptCPU.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptFileIO.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptIO.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptLibrary.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptOS.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptPathString.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptTime.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptUUID.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mutex.h"> <Filter>common</Filter> </ClInclude> @@ -598,18 +613,33 @@ <ClCompile Include="..\..\common\misc_util.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptCPU.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptFileIO.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptIO.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptLibrary.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptOS.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptPathString.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptTime.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptUUID.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\serialization_utils.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -190,10 +190,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -259,10 +264,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp" /> <ClCompile Include="..\..\common\typedefs.cpp" /> Modified: trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -51,18 +51,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptCPU.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptFileIO.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptIO.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptLibrary.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptOS.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptPathString.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptTime.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptUUID.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mutex.h"> <Filter>common</Filter> </ClInclude> @@ -254,18 +269,33 @@ <ClCompile Include="..\..\common\misc_util.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptCPU.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptFileIO.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptIO.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptLibrary.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptOS.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptPathString.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptTime.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptUUID.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\serialization_utils.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -194,10 +194,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -263,10 +268,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp" /> <ClCompile Include="..\..\common\typedefs.cpp" /> Modified: trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -51,18 +51,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptCPU.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptFileIO.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptIO.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptLibrary.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptOS.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptPathString.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptTime.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptUUID.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mutex.h"> <Filter>common</Filter> </ClInclude> @@ -254,18 +269,33 @@ <ClCompile Include="..\..\common\misc_util.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptCPU.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptFileIO.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptIO.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptLibrary.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptOS.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptPathString.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptTime.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptUUID.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\serialization_utils.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -198,10 +198,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -271,10 +276,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp" /> <ClCompile Include="..\..\common\typedefs.cpp" /> Modified: trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -54,18 +54,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptCPU.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptFileIO.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptIO.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptLibrary.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptOS.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptPathString.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptTime.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptUUID.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mutex.h"> <Filter>common</Filter> </ClInclude> @@ -269,18 +284,33 @@ <ClCompile Include="..\..\common\misc_util.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptCPU.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptFileIO.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptIO.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptLibrary.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptOS.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptPathString.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptTime.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptUUID.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\serialization_utils.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -367,10 +367,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -542,10 +547,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp"> <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> Modified: trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -77,18 +77,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptCPU.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptFileIO.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptIO.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptLibrary.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptOS.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptPathString.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptTime.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptUUID.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mutex.h"> <Filter>common</Filter> </ClInclude> @@ -598,18 +613,33 @@ <ClCompile Include="..\..\common\misc_util.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptCPU.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptFileIO.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptIO.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptLibrary.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptOS.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptPathString.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptTime.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptUUID.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\serialization_utils.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -191,10 +191,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -260,10 +265,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp" /> <ClCompile Include="..\..\common\typedefs.cpp" /> Modified: trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -51,18 +51,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptCPU.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptFileIO.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptIO.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptLibrary.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptOS.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptPathString.h"> <Filter>common</Filter> </ClInclude> <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptTime.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptUUID.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mutex.h"> <Filter>common</Filter> </ClInclude> @@ -254,18 +269,33 @@ <ClCompile Include="..\..\common\misc_util.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptCPU.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptFileIO.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptIO.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptLibrary.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptOS.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptPathString.cpp"> <Filter>common</Filter> </ClCompile> <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptTime.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptUUID.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\serialization_utils.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj 2015-06-02 14:03:30 UTC (rev 5236) @@ -195,10 +195,15 @@ <ClInclude Include="..\..\common\WriteMemoryDump.h" /> <ClInclude Include="..\..\common\misc_util.h" /> <ClInclude Include="..\..\common\mptAtomic.h" /> + <ClInclude Include="..\..\common\mptCPU.h" /> <ClInclude Include="..\..\common\mptFileIO.h" /> <ClInclude Include="..\..\common\mptIO.h" /> + <ClInclude Include="..\..\common\mptLibrary.h" /> + <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptTime.h" /> + <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> <ClInclude Include="..\..\common\serialization_utils.h" /> <ClInclude Include="..\..\common\stdafx.h" /> @@ -264,10 +269,15 @@ <ClCompile Include="..\..\common\Logging.cpp" /> <ClCompile Include="..\..\common\Profiler.cpp" /> <ClCompile Include="..\..\common\misc_util.cpp" /> + <ClCompile Include="..\..\common\mptCPU.cpp" /> <ClCompile Include="..\..\common\mptFileIO.cpp" /> <ClCompile Include="..\..\common\mptIO.cpp" /> + <ClCompile Include="..\..\common\mptLibrary.cpp" /> + <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptTime.cpp" /> + <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> <ClCompile Include="..\..\common\stdafx.cpp" /> <ClCompile Include="..\..\common\typedefs.cpp" /> Modified: trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters 2015-06-02 12:42:26 UTC (rev 5235) +++ trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters 2015-06-02 14:03:30 UTC (rev 5236) @@ -51,18 +51,33 @@ <ClInclude Include="..\..\common\mptAtomic.h"> <... [truncated message content] |
From: <sag...@us...> - 2015-06-02 14:23:21
|
Revision: 5237 http://sourceforge.net/p/modplug/code/5237 Author: saga-games Date: 2015-06-02 14:23:15 +0000 (Tue, 02 Jun 2015) Log Message: ----------- [Ref] ConvertInt2MIDI was completely unused and ConvertMIDI2Int was only used in Load_mid.cpp. Kill the former and move the latter from misc_util.h to Load_mid.cpp. Modified Paths: -------------- trunk/OpenMPT/common/misc_util.h trunk/OpenMPT/soundlib/Load_mid.cpp Modified: trunk/OpenMPT/common/misc_util.h =================================================================== --- trunk/OpenMPT/common/misc_util.h 2015-06-02 14:03:30 UTC (rev 5236) +++ trunk/OpenMPT/common/misc_util.h 2015-06-02 14:23:15 UTC (rev 5237) @@ -379,64 +379,6 @@ } -// Convert a variable-length MIDI integer held in the byte buffer <value> to a normal integer <result>. -// maxLength bytes are read from the byte buffer at max. -// Function returns how many bytes have been read. -// TODO This should report overflow errors if TOut is too small! -template <class TOut> -size_t ConvertMIDI2Int(TOut &result, uint8 *value, size_t maxLength) -//------------------------------------------------------------------ -{ - static_assert(std::numeric_limits<TOut>::is_integer == true, "Output type is a not an integer"); - - if(maxLength <= 0) - { - result = 0; - return 0; - } - size_t bytesUsed = 0; - result = 0; - uint8 b; - do - { - b = *value; - result <<= 7; - result |= (b & 0x7F); - value++; - } while (++bytesUsed < maxLength && (b & 0x80) != 0); - return bytesUsed; -} - - -// Convert an integer <value> to a variable-length MIDI integer, held in the byte buffer <result>. -// maxLength bytes are written to the byte buffer at max. -// Function returns how many bytes have been written. -template <class TIn> -size_t ConvertInt2MIDI(uint8 *result, size_t maxLength, TIn value) -//---------------------------------------------------------------- -{ - static_assert(std::numeric_limits<TIn>::is_integer == true, "Input type is a not an integer"); - - if(maxLength <= 0) - { - *result = 0; - return 0; - } - size_t bytesUsed = 0; - do - { - *result = (value & 0x7F); - value >>= 7; - if(value != 0) - { - *result |= 0x80; - } - result++; - } while (++bytesUsed < maxLength && value != 0); - return bytesUsed; -} - - namespace Util { Modified: trunk/OpenMPT/soundlib/Load_mid.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mid.cpp 2015-06-02 14:03:30 UTC (rev 5236) +++ trunk/OpenMPT/soundlib/Load_mid.cpp 2015-06-02 14:23:15 UTC (rev 5237) @@ -340,9 +340,36 @@ /////////////////////////////////////////////////////////////////////////// // Helper functions +// Convert a variable-length MIDI integer held in the byte buffer <value> to a normal integer <result>. +// maxLength bytes are read from the byte buffer at max. +// Function returns how many bytes have been read. +template <class TOut> +static size_t ConvertMIDI2Int(TOut &result, uint8 *value, size_t maxLength) +//------------------------------------------------------------------------- +{ + static_assert(std::numeric_limits<TOut>::is_integer == true, "Output type is a not an integer"); + + if(maxLength <= 0) + { + result = 0; + return 0; + } + size_t bytesUsed = 0; + result = 0; + uint8 b; + do + { + b = *value; + result <<= 7; + result |= (b & 0x7F); + value++; + } while (++bytesUsed < maxLength && (b & 0x80) != 0); + return bytesUsed; +} + // Returns MOD tempo and tick multiplier static int ConvertMidiTempo(int tempo_us, int &tickMultiplier, int importSpeed) -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- { int nBestModTempo = 120; int nBestError = 1000000; // 1s This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-06-02 15:12:07
|
Revision: 5240 http://sourceforge.net/p/modplug/code/5240 Author: manxorist Date: 2015-06-02 15:11:53 +0000 (Tue, 02 Jun 2015) Log Message: ----------- [Ref] Split out mptStringFormat and mptStringParse. Modified Paths: -------------- trunk/OpenMPT/build/android_ndk/Android-unmo3.mk trunk/OpenMPT/build/android_ndk/Android.mk trunk/OpenMPT/build/autotools/Makefile.am trunk/OpenMPT/build/vs2008/OpenMPT.vcproj trunk/OpenMPT/build/vs2008/libopenmpt.vcproj trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj.filters trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj.filters trunk/OpenMPT/common/misc_util.cpp trunk/OpenMPT/common/misc_util.h trunk/OpenMPT/common/mptString.cpp trunk/OpenMPT/common/mptString.h trunk/OpenMPT/common/stdafx.h trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters Added Paths: ----------- trunk/OpenMPT/common/mptStringFormat.cpp trunk/OpenMPT/common/mptStringFormat.h trunk/OpenMPT/common/mptStringParse.cpp trunk/OpenMPT/common/mptStringParse.h Modified: trunk/OpenMPT/build/android_ndk/Android-unmo3.mk =================================================================== --- trunk/OpenMPT/build/android_ndk/Android-unmo3.mk 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/android_ndk/Android-unmo3.mk 2015-06-02 15:11:53 UTC (rev 5240) @@ -60,6 +60,8 @@ common/mptOS.cpp \ common/mptPathString.cpp \ common/mptString.cpp \ + common/mptStringFormat.cpp \ + common/mptStringParse.cpp \ common/mptTime.cpp \ common/mptUUID.cpp \ common/Profiler.cpp \ Modified: trunk/OpenMPT/build/android_ndk/Android.mk =================================================================== --- trunk/OpenMPT/build/android_ndk/Android.mk 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/android_ndk/Android.mk 2015-06-02 15:11:53 UTC (rev 5240) @@ -28,6 +28,8 @@ common/mptOS.cpp \ common/mptPathString.cpp \ common/mptString.cpp \ + common/mptStringFormat.cpp \ + common/mptStringParse.cpp \ common/mptTime.cpp \ common/mptUUID.cpp \ common/Profiler.cpp \ Modified: trunk/OpenMPT/build/autotools/Makefile.am =================================================================== --- trunk/OpenMPT/build/autotools/Makefile.am 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/autotools/Makefile.am 2015-06-02 15:11:53 UTC (rev 5240) @@ -104,6 +104,10 @@ libopenmpt_la_SOURCES += common/mptPathString.h libopenmpt_la_SOURCES += common/mptString.cpp libopenmpt_la_SOURCES += common/mptString.h +libopenmpt_la_SOURCES += common/mptStringFormat.cpp +libopenmpt_la_SOURCES += common/mptStringFormat.h +libopenmpt_la_SOURCES += common/mptStringParse.cpp +libopenmpt_la_SOURCES += common/mptStringParse.h libopenmpt_la_SOURCES += common/mptTime.cpp libopenmpt_la_SOURCES += common/mptTime.h libopenmpt_la_SOURCES += common/mptUUID.cpp @@ -316,6 +320,10 @@ libopenmpttest_SOURCES += common/mptPathString.h libopenmpttest_SOURCES += common/mptString.cpp libopenmpttest_SOURCES += common/mptString.h +libopenmpttest_SOURCES += common/mptStringFormat.cpp +libopenmpttest_SOURCES += common/mptStringFormat.h +libopenmpttest_SOURCES += common/mptStringParse.cpp +libopenmpttest_SOURCES += common/mptStringParse.h libopenmpttest_SOURCES += common/mptTime.cpp libopenmpttest_SOURCES += common/mptTime.h libopenmpttest_SOURCES += common/mptUUID.cpp Modified: trunk/OpenMPT/build/vs2008/OpenMPT.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/OpenMPT.vcproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2008/OpenMPT.vcproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -716,6 +716,22 @@ > </File> <File + RelativePath="..\..\common\mptStringFormat.cpp" + > + </File> + <File + RelativePath="..\..\common\mptStringFormat.h" + > + </File> + <File + RelativePath="..\..\common\mptStringParse.cpp" + > + </File> + <File + RelativePath="..\..\common\mptStringParse.h" + > + </File> + <File RelativePath="..\..\common\mptTime.cpp" > </File> Modified: trunk/OpenMPT/build/vs2008/libopenmpt.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/libopenmpt.vcproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2008/libopenmpt.vcproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -431,6 +431,22 @@ > </File> <File + RelativePath="..\..\common\mptStringFormat.cpp" + > + </File> + <File + RelativePath="..\..\common\mptStringFormat.h" + > + </File> + <File + RelativePath="..\..\common\mptStringParse.cpp" + > + </File> + <File + RelativePath="..\..\common\mptStringParse.h" + > + </File> + <File RelativePath="..\..\common\mptTime.cpp" > </File> Modified: trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2008/libopenmptDLL.vcproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -479,6 +479,22 @@ > </File> <File + RelativePath="..\..\common\mptStringFormat.cpp" + > + </File> + <File + RelativePath="..\..\common\mptStringFormat.h" + > + </File> + <File + RelativePath="..\..\common\mptStringParse.cpp" + > + </File> + <File + RelativePath="..\..\common\mptStringParse.h" + > + </File> + <File RelativePath="..\..\common\mptTime.cpp" > </File> Modified: trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2008/libopenmpt_test.vcproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -475,6 +475,22 @@ > </File> <File + RelativePath="..\..\common\mptStringFormat.cpp" + > + </File> + <File + RelativePath="..\..\common\mptStringFormat.h" + > + </File> + <File + RelativePath="..\..\common\mptStringParse.cpp" + > + </File> + <File + RelativePath="..\..\common\mptStringParse.h" + > + </File> + <File RelativePath="..\..\common\mptTime.cpp" > </File> Modified: trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -367,6 +367,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -547,6 +549,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2010/OpenMPT.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -98,6 +98,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -634,6 +640,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -193,6 +193,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -267,6 +269,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2010/libopenmpt.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -72,6 +72,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -290,6 +296,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -197,6 +197,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -271,6 +273,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2010/libopenmptDLL.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -72,6 +72,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -290,6 +296,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -201,6 +201,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -279,6 +281,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2010/libopenmpt_test.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -75,6 +75,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -305,6 +311,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -373,6 +373,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -553,6 +555,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2012/OpenMPT.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -98,6 +98,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -634,6 +640,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -197,6 +197,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -271,6 +273,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2012/libopenmpt.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -72,6 +72,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -290,6 +296,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -201,6 +201,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -275,6 +277,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2012/libopenmptDLL.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -72,6 +72,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -290,6 +296,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -205,6 +205,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -283,6 +285,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2012/libopenmpt_test.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -75,6 +75,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -305,6 +311,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -374,6 +374,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -554,6 +556,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2013/OpenMPT.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -98,6 +98,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -634,6 +640,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -198,6 +198,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -272,6 +274,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2013/libopenmpt.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -72,6 +72,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -290,6 +296,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -202,6 +202,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -276,6 +278,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2013/libopenmptDLL.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -72,6 +72,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -290,6 +296,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -206,6 +206,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -284,6 +286,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2013/libopenmpt_test.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -75,6 +75,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -305,6 +311,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -374,6 +374,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -554,6 +556,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2015/OpenMPT.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -98,6 +98,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -634,6 +640,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -198,6 +198,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -272,6 +274,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2015/libopenmpt.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -72,6 +72,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -290,6 +296,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -202,6 +202,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -276,6 +278,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2015/libopenmptDLL.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -72,6 +72,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -290,6 +296,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj 2015-06-02 15:11:53 UTC (rev 5240) @@ -206,6 +206,8 @@ <ClInclude Include="..\..\common\mptOS.h" /> <ClInclude Include="..\..\common\mptPathString.h" /> <ClInclude Include="..\..\common\mptString.h" /> + <ClInclude Include="..\..\common\mptStringFormat.h" /> + <ClInclude Include="..\..\common\mptStringParse.h" /> <ClInclude Include="..\..\common\mptTime.h" /> <ClInclude Include="..\..\common\mptUUID.h" /> <ClInclude Include="..\..\common\mutex.h" /> @@ -284,6 +286,8 @@ <ClCompile Include="..\..\common\mptOS.cpp" /> <ClCompile Include="..\..\common\mptPathString.cpp" /> <ClCompile Include="..\..\common\mptString.cpp" /> + <ClCompile Include="..\..\common\mptStringFormat.cpp" /> + <ClCompile Include="..\..\common\mptStringParse.cpp" /> <ClCompile Include="..\..\common\mptTime.cpp" /> <ClCompile Include="..\..\common\mptUUID.cpp" /> <ClCompile Include="..\..\common\serialization_utils.cpp" /> Modified: trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj.filters =================================================================== --- trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj.filters 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/build/vs2015/libopenmpt_test.vcxproj.filters 2015-06-02 15:11:53 UTC (rev 5240) @@ -75,6 +75,12 @@ <ClInclude Include="..\..\common\mptString.h"> <Filter>common</Filter> </ClInclude> + <ClInclude Include="..\..\common\mptStringFormat.h"> + <Filter>common</Filter> + </ClInclude> + <ClInclude Include="..\..\common\mptStringParse.h"> + <Filter>common</Filter> + </ClInclude> <ClInclude Include="..\..\common\mptTime.h"> <Filter>common</Filter> </ClInclude> @@ -305,6 +311,12 @@ <ClCompile Include="..\..\common\mptString.cpp"> <Filter>common</Filter> </ClCompile> + <ClCompile Include="..\..\common\mptStringFormat.cpp"> + <Filter>common</Filter> + </ClCompile> + <ClCompile Include="..\..\common\mptStringParse.cpp"> + <Filter>common</Filter> + </ClCompile> <ClCompile Include="..\..\common\mptTime.cpp"> <Filter>common</Filter> </ClCompile> Modified: trunk/OpenMPT/common/misc_util.cpp =================================================================== --- trunk/OpenMPT/common/misc_util.cpp 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/common/misc_util.cpp 2015-06-02 15:11:53 UTC (rev 5240) @@ -11,82 +11,11 @@ #include "stdafx.h" #include "misc_util.h" -#include <locale> -#include <sstream> - OPENMPT_NAMESPACE_BEGIN -template<typename T> -inline T ConvertStrToHelper(const std::string &str) -{ - std::istringstream i(str); - i.imbue(std::locale::classic()); - T x; - if(!(i >> x)) - { - return T(); - } - return x; -} -template<> inline bool ConvertStrToHelper(const std::string &str) { return ConvertStrToHelper<int>(str)?true:false; } -template<> inline signed char ConvertStrToHelper(const std::string &str) { return static_cast<signed char>(ConvertStrToHelper<signed int>(str)); } -template<> inline unsigned char ConvertStrToHelper(const std::string &str) { return static_cast<unsigned char>(ConvertStrToHelper<unsigned int>(str)); } -#if MPT_WSTRING_FORMAT -template<typename T> -inline T ConvertStrToHelper(const std::wstring &str) -{ - std::wistringstream i(str); - i.imbue(std::locale::classic()); - T x; - if(!(i >> x)) - { - return T(); - } - return x; -} -template<> inline bool ConvertStrToHelper(const std::wstring &str) { return ConvertStrToHelper<int>(str)?true:false; } -template<> inline signed char ConvertStrToHelper(const std::wstring &str) { return static_cast<signed char>(ConvertStrToHelper<signed int>(str)); } -template<> inline unsigned char ConvertStrToHelper(const std::wstring &str) { return static_cast<unsigned char>(ConvertStrToHelper<unsigned int>(str)); } -#endif - -bool ConvertStrToBool(const std::string &str) { return ConvertStrToHelper<bool>(str); } -signed char ConvertStrToSignedChar(const std::string &str) { return ConvertStrToHelper<signed char>(str); } -unsigned char ConvertStrToUnsignedChar(const std::string &str) { return ConvertStrToHelper<unsigned char>(str); } -signed short ConvertStrToSignedShort(const std::string &str) { return ConvertStrToHelper<signed short>(str); } -unsigned short ConvertStrToUnsignedShort(const std::string &str) { return ConvertStrToHelper<unsigned short>(str); } -signed int ConvertStrToSignedInt(const std::string &str) { return ConvertStrToHelper<signed int>(str); } -unsigned int ConvertStrToUnsignedInt(const std::string &str) { return ConvertStrToHelper<unsigned int>(str); } -signed long ConvertStrToSignedLong(const std::string &str) { return ConvertStrToHelper<signed long>(str); } -unsigned long ConvertStrToUnsignedLong(const std::string &str) { return ConvertStrToHelper<unsigned long>(str); } -signed long long ConvertStrToSignedLongLong(const std::string &str) { return ConvertStrToHelper<signed long long>(str); } -unsigned long long ConvertStrToUnsignedLongLong(const std::string &str) { return ConvertStrToHelper<unsigned long long>(str); } -float ConvertStrToFloat(const std::string &str) { return ConvertStrToHelper<float>(str); } -double ConvertStrToDouble(const std::string &str) { return ConvertStrToHelper<double>(str); } -long double ConvertStrToLongDouble(const std::string &str) { return ConvertStrToHelper<long double>(str); } - -#if MPT_WSTRING_FORMAT -bool ConvertStrToBool(const std::wstring &str) { return ConvertStrToHelper<bool>(str); } -signed char ConvertStrToSignedChar(const std::wstring &str) { return ConvertStrToHelper<signed char>(str); } -unsigned char ConvertStrToUnsignedChar(const std::wstring &str) { return ConvertStrToHelper<unsigned char>(str); } -signed short ConvertStrToSignedShort(const std::wstring &str) { return ConvertStrToHelper<signed short>(str); } -unsigned short ConvertStrToUnsignedShort(const std::wstring &str) { return ConvertStrToHelper<unsigned short>(str); } -signed int ConvertStrToSignedInt(const std::wstring &str) { return ConvertStrToHelper<signed int>(str); } -unsigned int ConvertStrToUnsignedInt(const std::wstring &str) { return ConvertStrToHelper<unsigned int>(str); } -signed long ConvertStrToSignedLong(const std::wstring &str) { return ConvertStrToHelper<signed long>(str); } -unsigned long ConvertStrToUnsignedLong(const std::wstring &str) { return ConvertStrToHelper<unsigned long>(str); } -signed long long ConvertStrToSignedLongLong(const std::wstring &str) { return ConvertStrToHelper<signed long long>(str); } -unsigned long long ConvertStrToUnsignedLongLong(const std::wstring &str) { return ConvertStrToHelper<unsigned long long>(str); } -float ConvertStrToFloat(const std::wstring &str) { return ConvertStrToHelper<float>(str); } -double ConvertStrToDouble(const std::wstring &str) { return ConvertStrToHelper<double>(str); } -long double ConvertStrToLongDouble(const std::wstring &str) { return ConvertStrToHelper<long double>(str); } -#endif - - - - #ifdef MODPLUG_TRACKER namespace Util Modified: trunk/OpenMPT/common/misc_util.h =================================================================== --- trunk/OpenMPT/common/misc_util.h 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/common/misc_util.h 2015-06-02 15:11:53 UTC (rev 5240) @@ -10,6 +10,7 @@ #pragma once +#include "mptStringParse.h" #include "mptCPU.h" #include "mptOS.h" #include "mptTime.h" @@ -40,108 +41,7 @@ #endif -bool ConvertStrToBool(const std::string &str); -signed char ConvertStrToSignedChar(const std::string &str); -unsigned char ConvertStrToUnsignedChar(const std::string &str); -signed short ConvertStrToSignedShort(const std::string &str); -unsigned short ConvertStrToUnsignedShort(const std::string &str); -signed int ConvertStrToSignedInt(const std::string &str); -unsigned int ConvertStrToUnsignedInt(const std::string &str); -signed long ConvertStrToSignedLong(const std::string &str); -unsigned long ConvertStrToUnsignedLong(const std::string &str); -signed long long ConvertStrToSignedLongLong(const std::string &str); -unsigned long long ConvertStrToUnsignedLongLong(const std::string &str); -float ConvertStrToFloat(const std::string &str); -double ConvertStrToDouble(const std::string &str); -long double ConvertStrToLongDouble(const std::string &str); -template<typename T> inline T ConvertStrTo(const std::string &str); // not defined, generates compiler error for non-specialized types -template<> inline std::string ConvertStrTo(const std::string &str) { return str; } -template<> inline bool ConvertStrTo(const std::string &str) { return ConvertStrToBool(str); } -template<> inline signed char ConvertStrTo(const std::string &str) { return ConvertStrToSignedChar(str); } -template<> inline unsigned char ConvertStrTo(const std::string &str) { return ConvertStrToUnsignedChar(str); } -template<> inline signed short ConvertStrTo(const std::string &str) { return ConvertStrToSignedShort(str); } -template<> inline unsigned short ConvertStrTo(const std::string &str) { return ConvertStrToUnsignedShort(str); } -template<> inline signed int ConvertStrTo(const std::string &str) { return ConvertStrToSignedInt(str); } -template<> inline unsigned int ConvertStrTo(const std::string &str) { return ConvertStrToUnsignedInt(str); } -template<> inline signed long ConvertStrTo(const std::string &str) { return ConvertStrToSignedLong(str); } -template<> inline unsigned long ConvertStrTo(const std::string &str) { return ConvertStrToUnsignedLong(str); } -template<> inline signed long long ConvertStrTo(const std::string &str) { return ConvertStrToSignedLongLong(str); } -template<> inline unsigned long long ConvertStrTo(const std::string &str) { return ConvertStrToUnsignedLongLong(str); } -template<> inline float ConvertStrTo(const std::string &str) { return ConvertStrToFloat(str); } -template<> inline double ConvertStrTo(const std::string &str) { return ConvertStrToDouble(str); } -template<> inline long double ConvertStrTo(const std::string &str) { return ConvertStrToLongDouble(str); } -#if MPT_WSTRING_FORMAT -bool ConvertStrToBool(const std::wstring &str); -signed char ConvertStrToSignedChar(const std::wstring &str); -unsigned char ConvertStrToUnsignedChar(const std::wstring &str); -signed short ConvertStrToSignedShort(const std::wstring &str); -unsigned short ConvertStrToUnsignedShort(const std::wstring &str); -signed int ConvertStrToSignedInt(const std::wstring &str); -unsigned int ConvertStrToUnsignedInt(const std::wstring &str); -signed long ConvertStrToSignedLong(const std::wstring &str); -unsigned long ConvertStrToUnsignedLong(const std::wstring &str); -signed long long ConvertStrToSignedLongLong(const std::wstring &str); -unsigned long long ConvertStrToUnsignedLongLong(const std::wstring &str); -float ConvertStrToFloat(const std::wstring &str); -double ConvertStrToDouble(const std::wstring &str); -long double ConvertStrToLongDouble(const std::wstring &str); -template<typename T> inline T ConvertStrTo(const std::wstring &str); // not defined, generates compiler error for non-specialized types -template<> inline std::wstring ConvertStrTo(const std::wstring &str) { return str; } -template<> inline bool ConvertStrTo(const std::wstring &str) { return ConvertStrToBool(str); } -template<> inline signed char ConvertStrTo(const std::wstring &str) { return ConvertStrToSignedChar(str); } -template<> inline unsigned char ConvertStrTo(const std::wstring &str) { return ConvertStrToUnsignedChar(str); } -template<> inline signed short ConvertStrTo(const std::wstring &str) { return ConvertStrToSignedShort(str); } -template<> inline unsigned short ConvertStrTo(const std::wstring &str) { return ConvertStrToUnsignedShort(str); } -template<> inline signed int ConvertStrTo(const std::wstring &str) { return ConvertStrToSignedInt(str); } -template<> inline unsigned int ConvertStrTo(const std::wstring &str) { return ConvertStrToUnsignedInt(str); } -template<> inline signed long ConvertStrTo(const std::wstring &str) { return ConvertStrToSignedLong(str); } -template<> inline unsigned long ConvertStrTo(const std::wstring &str) { return ConvertStrToUnsignedLong(str); } -template<> inline signed long long ConvertStrTo(const std::wstring &str) { return ConvertStrToSignedLongLong(str); } -template<> inline unsigned long long ConvertStrTo(const std::wstring &str) { return ConvertStrToUnsignedLongLong(str); } -template<> inline float ConvertStrTo(const std::wstring &str) { return ConvertStrToFloat(str); } -template<> inline double ConvertStrTo(const std::wstring &str) { return ConvertStrToDouble(str); } -template<> inline long double ConvertStrTo(const std::wstring &str) { return ConvertStrToLongDouble(str); } -#endif - -template<typename T> -inline T ConvertStrTo(const char *str) -{ - if(!str) - { - return T(); - } - return ConvertStrTo<T>(std::string(str)); -} - -#if MPT_WSTRING_FORMAT -template<typename T> -inline T ConvertStrTo(const wchar_t *str) -{ - if(!str) - { - return T(); - } - return ConvertStrTo<T>(std::wstring(str)); -} -#if MPT_USTRING_MODE_UTF8 -template<> inline mpt::ustring ConvertStrTo(const std::wstring &str) { return mpt::ToUnicode(str); } -#endif -#endif - -#if MPT_USTRING_MODE_UTF8 -template<typename T> -inline T ConvertStrTo(const mpt::ustring &str) -{ - return ConvertStrTo<T>(mpt::ToCharset(mpt::CharsetUTF8, str)); -} -template<> inline mpt::ustring ConvertStrTo(const mpt::ustring &str) { return str; } -#if MPT_WSTRING_CONVERT -template<> inline std::wstring ConvertStrTo(const mpt::ustring &str) { return mpt::ToWide(str); } -#endif -#endif - - namespace mpt { namespace String { // Combine a vector of values into a string, separated with the given separator. Modified: trunk/OpenMPT/common/mptString.cpp =================================================================== --- trunk/OpenMPT/common/mptString.cpp 2015-06-02 15:11:33 UTC (rev 5239) +++ trunk/OpenMPT/common/mptString.cpp 2015-06-02 15:11:53 UTC (rev 5240) @@ -16,9 +16,7 @@ #if defined(MPT_CHARSET_INTERNAL) || defined(MPT_CHARSET_WIN32) #include <cstdlib> #endif -#include <iomanip> #include <locale> -#include <sstream> #include <string> #include <stdexcept> #include <vector> @@ -1530,442 +1528,4 @@ -namespace mpt -{ - - -template<typename Tstream, typename T> inline void SaneInsert(Tstream & s, const T & x) { s << x; } -// do the right thing for signed/unsigned char and bool -template<typename Tstream> void SaneInsert(Tstream & s, const bool & x) { s << static_cast<int>(x); } -template<typename Tstream> void SaneInsert(Tstream & s, const signed char & x) { s << static_cast<signed int>(x); } -template<typename Tstream> void SaneInsert(Tstream & s, const unsigned char & x) { s << static_cast<unsigned int>(x); } - -template<typename T> -inline std::string ToStringHelper(const T & x) -{ - std::ostringstream o; - o.imbue(std::locale::classic()); - SaneInsert(o, x); - return o.str(); -} - -#if MPT_WSTRING_FORMAT -template<typename T> -inline std::wstring ToWStringHelper(const T & x) -{ - std::wostringstream o; - o.imbue(std::locale::classic()); - SaneInsert(o, x); - return o.str(); -} -#endif - -#if MPT_WSTRING_CONVERT -#if defined(MPT_WITH_CHARSET_LOCALE) -std::string ToString(const std::wstring & x) { return mpt::ToLocale(x); } -std::string ToString(const wchar_t * const & x) { return mpt::ToLocale(x); } -std::string ToString(const wchar_t & x) { return mpt::ToLocale(std::wstring(1, x)); } -#else -std::string ToString(const std::wstring & x) { return mpt::ToCharset(mpt::CharsetUTF8, x); } -std::string ToString(const wchar_t * const & x) { return mpt::ToCharset(mpt::CharsetUTF8, x); } -std::string ToString(const wchar_t & x) { return mpt::ToCharset(mpt::CharsetUTF8, std::wstring(1, x)); } -#endif -#endif -#if MPT_USTRING_MODE_UTF8 -#if defined(MPT_WITH_CHARSET_LOCALE) -std::... [truncated message content] |
From: <man...@us...> - 2015-06-03 09:42:40
|
Revision: 5241 http://sourceforge.net/p/modplug/code/5241 Author: manxorist Date: 2015-06-03 09:42:34 +0000 (Wed, 03 Jun 2015) Log Message: ----------- [Ref] Cleanup some mpt::ToLocale uses. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp trunk/OpenMPT/soundlib/plugins/PluginManager.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2015-06-02 15:11:53 UTC (rev 5240) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2015-06-03 09:42:34 UTC (rev 5241) @@ -2853,7 +2853,7 @@ str.Preallocate(80); str.Format(_T("FX%d: "), iPlug + 1); const int size0 = str.GetLength(); - str += (librarynames) ? mpt::ToLocale(mpt::CharsetUTF8, plugin.GetLibraryName()).c_str() : plugin.GetName(); + str += (librarynames) ? mpt::ToCString(mpt::CharsetUTF8, plugin.GetLibraryName()) : CString(plugin.GetName()); if(str.GetLength() <= size0) str += _T("undefined"); CBox.SetItemData(CBox.AddString(str), iPlug + 1); Modified: trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2015-06-02 15:11:53 UTC (rev 5240) +++ trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2015-06-03 09:42:34 UTC (rev 5241) @@ -123,7 +123,7 @@ break; } const std::wstring keyname = keynameBuf; - Log(mpt::String::Print("ASIO: Found '%1':", mpt::ToLocale(keyname))); + Log(mpt::String::Print(MPT_USTRING("ASIO: Found '%1':"), keyname)); HKEY hksub = NULL; if(RegOpenKeyExW(hkEnum, keynameBuf, 0, KEY_READ, &hksub) != ERROR_SUCCESS) @@ -137,7 +137,7 @@ mpt::ustring description; if(ERROR_SUCCESS == RegQueryValueExW(hksub, L"Description", 0, &datatype, (LPBYTE)descriptionBuf, &datasize)) { - Log(mpt::String::Print("ASIO: description='%1'", mpt::ToLocale(description))); + Log(mpt::String::Print(MPT_USTRING("ASIO: description='%1'"), description)); description = mpt::ToUnicode(descriptionBuf); } else { @@ -152,7 +152,7 @@ const mpt::ustring internalID = mpt::ToUnicode(idBuf); if(Util::IsCLSID(mpt::ToWide(internalID))) { - Log(mpt::String::Print("ASIO: clsid=%1", mpt::ToLocale(internalID))); + Log(mpt::String::Print(MPT_USTRING("ASIO: clsid=%1"), internalID)); SoundDevice::Info info; info.type = TypeASIO; info.internalID = internalID; @@ -257,8 +257,8 @@ InitMembers(); - Log(mpt::String::Print("ASIO: Open('%1'): %2-bit, (%3,%4) channels, %5Hz, hw-timing=%6" - , mpt::ToLocale(GetDeviceInternalID()) + Log(mpt::String::Print(MPT_USTRING("ASIO: Open('%1'): %2-bit, (%3,%4) channels, %5Hz, hw-timing=%6") + , GetDeviceInternalID() , m_Settings.sampleFormat.GetBitsPerSample() , m_Settings.InputChannels , m_Settings.Channels Modified: trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp 2015-06-02 15:11:53 UTC (rev 5240) +++ trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp 2015-06-03 09:42:34 UTC (rev 5241) @@ -489,7 +489,7 @@ result.apiPath.push_back(MPT_USTRING("PortAudio")); result.isDefault = (Pa_GetHostApiInfo(Pa_GetDeviceInfo(dev)->hostApi)->defaultOutputDevice == (PaDeviceIndex)dev); result.useNameAsIdentifier = true; - PALOG(mpt::String::Print("PortAudio: %1, %2, %3, %4", result.id.GetIdRaw(), mpt::ToLocale(result.name), mpt::ToLocale(result.apiName), result.isDefault)); + PALOG(mpt::String::Print(MPT_USTRING("PortAudio: %1, %2, %3, %4"), result.id.GetIdRaw(), result.name, result.apiName, result.isDefault)); PALOG(mpt::String::Print(" low : %1", Pa_GetDeviceInfo(dev)->defaultLowOutputLatency)); PALOG(mpt::String::Print(" high : %1", Pa_GetDeviceInfo(dev)->defaultHighOutputLatency)); devices.push_back(result); Modified: trunk/OpenMPT/soundlib/plugins/PluginManager.cpp =================================================================== --- trunk/OpenMPT/soundlib/plugins/PluginManager.cpp 2015-06-02 15:11:53 UTC (rev 5240) +++ trunk/OpenMPT/soundlib/plugins/PluginManager.cpp 2015-06-03 09:42:34 UTC (rev 5241) @@ -644,7 +644,7 @@ { Reporting::Notification(msg); #ifdef VST_LOG - Log("%s", mpt::ToLocale(msg).c_str()); + Log(mpt::ToUnicode(msg)); #endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-04 11:15:54
|
Revision: 5246 http://sourceforge.net/p/modplug/code/5246 Author: saga-games Date: 2015-06-04 11:15:48 +0000 (Thu, 04 Jun 2015) Log Message: ----------- [Mod] The working directory is now set to "My Documents" on startup rather than the executable directory. This is done since the tree view and, possibly, open/save file dialogs (if never used before) may use the working directory as a default directory. [Ref] Combine mpt::PathString::HasTrailingSlash + slash addition into mpt::PathString::EnsureTrailingSlash Modified Paths: -------------- trunk/OpenMPT/common/mptPathString.h trunk/OpenMPT/mptrack/FolderScanner.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/PathConfigDlg.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/View_tre.cpp Modified: trunk/OpenMPT/common/mptPathString.h =================================================================== --- trunk/OpenMPT/common/mptPathString.h 2015-06-03 23:13:38 UTC (rev 5245) +++ trunk/OpenMPT/common/mptPathString.h 2015-06-04 11:15:48 UTC (rev 5246) @@ -129,6 +129,18 @@ return (c == '/'); #endif } + mpt::PathString &EnsureTrailingSlash() + { + if(!path.empty() && !HasTrailingSlash()) + { +#if MPT_OS_WINDOWS + path += L'\\'; +#else + path += '/'; +#endif + } + return *this; + } // Relative / absolute paths conversion mpt::PathString AbsolutePathToRelative(const mpt::PathString &relativeTo) const; Modified: trunk/OpenMPT/mptrack/FolderScanner.cpp =================================================================== --- trunk/OpenMPT/mptrack/FolderScanner.cpp 2015-06-03 23:13:38 UTC (rev 5245) +++ trunk/OpenMPT/mptrack/FolderScanner.cpp 2015-06-04 11:15:48 UTC (rev 5246) @@ -43,7 +43,7 @@ currentPath = paths.back(); paths.pop_back(); - if(!currentPath.HasTrailingSlash()) currentPath += MPT_PATHSTRING("\\"); + currentPath.EnsureTrailingSlash(); hFind = FindFirstFileW((currentPath + MPT_PATHSTRING("*.*")).AsNative().c_str(), &wfd); } Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2015-06-03 23:13:38 UTC (rev 5245) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2015-06-04 11:15:48 UTC (rev 5246) @@ -71,7 +71,7 @@ { CDocument *pDoc = nullptr; mpt::PathString path = filename; - if(!path.HasTrailingSlash()) path += MPT_PATHSTRING("\\"); + path.EnsureTrailingSlash(); HANDLE hFind; WIN32_FIND_DATAW wfd; MemsetZero(wfd); @@ -456,10 +456,7 @@ if(!UltraSndPath.empty()) { tmp = UltraSndPath; - if(!tmp.HasTrailingSlash()) - { - tmp += MPT_PATHSTRING("\\"); - } + tmp.EnsureTrailingSlash(); } tmp += filename; tmp += MPT_PATHSTRING(".pat"); @@ -790,25 +787,24 @@ void CTrackApp::SetupPaths(bool overridePortable) //----------------------------------------------- { + // Set current directory to My Documents. If no sample / mod / etc. paths are set up by the user, this will be the default location for browsing files. + WCHAR dir[MAX_PATH] = { 0 }; + if(SHGetFolderPathW(NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, dir) == S_OK) + { + SetCurrentDirectoryW(dir); + } - // change to exe directory - - SetCurrentDirectoryW(mpt::GetAppPath().AsNative().c_str()); - - // Determine paths, portable mode, first run. Do not yet update any state. mpt::PathString configPathApp = mpt::GetAppPath(); // config path in portable mode mpt::PathString configPathGlobal; // config path in default non-portable mode { // Try to find a nice directory where we should store our settings (default: %APPDATA%) - WCHAR tempConfigDirectory[MAX_PATH]; - MemsetZero(tempConfigDirectory); - if((SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, tempConfigDirectory) == S_OK) - || (SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, tempConfigDirectory) == S_OK)) + if((SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, dir) == S_OK) + || (SHGetFolderPathW(NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, dir) == S_OK)) { - // Store our app settings in %APPDATA% or "My Files" - configPathGlobal = mpt::PathString::FromNative(tempConfigDirectory) + MPT_PATHSTRING("\\OpenMPT\\"); + // Store our app settings in %APPDATA% or "My Documents" + configPathGlobal = mpt::PathString::FromNative(dir) + MPT_PATHSTRING("\\OpenMPT\\"); } } Modified: trunk/OpenMPT/mptrack/PathConfigDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/PathConfigDlg.cpp 2015-06-03 23:13:38 UTC (rev 5245) +++ trunk/OpenMPT/mptrack/PathConfigDlg.cpp 2015-06-04 11:15:48 UTC (rev 5246) @@ -106,11 +106,7 @@ m_AutoSaver.SetSaveInterval(GetDlgItemInt(IDC_AUTOSAVE_INTERVAL)); m_AutoSaver.SetUseOriginalPath(IsDlgButtonChecked(IDC_AUTOSAVE_USEORIGDIR) == BST_CHECKED); ::GetDlgItemTextW(m_hWnd, IDC_AUTOSAVE_PATH, tempPath, CountOf(tempPath)); - mpt::PathString path = mpt::PathString::FromNative(tempPath); - if(!path.empty() && !path.HasTrailingSlash()) - { - path += MPT_PATHSTRING("\\"); - } + mpt::PathString path = mpt::PathString::FromNative(tempPath).EnsureTrailingSlash(); m_AutoSaver.SetPath(path); CPropertyPage::OnOK(); Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-06-03 23:13:38 UTC (rev 5245) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-06-04 11:15:48 UTC (rev 5246) @@ -1107,10 +1107,7 @@ //-------------------------------------------------------------------------------------------------------------------------- { mpt::PathString newPath = (stripFilename ? filenameFrom.GetPath() : filenameFrom); - if(!newPath.empty() && !newPath.HasTrailingSlash()) - { - newPath += MPT_PATHSTRING("\\"); - } + newPath.EnsureTrailingSlash(); mpt::PathString oldPath = dest; dest = newPath; return newPath != oldPath; Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2015-06-03 23:13:38 UTC (rev 5245) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2015-06-04 11:15:48 UTC (rev 5246) @@ -201,27 +201,21 @@ if(!IsSampleBrowser()) { - const mpt::PathString dirs[] = { + WCHAR curDir[MAX_PATH]; + GetCurrentDirectoryW(CountOf(curDir), curDir); + const mpt::PathString dirs[] = + { TrackerSettings::Instance().PathSamples.GetDefaultDir(), TrackerSettings::Instance().PathInstruments.GetDefaultDir(), - TrackerSettings::Instance().PathSongs.GetDefaultDir() + TrackerSettings::Instance().PathSongs.GetDefaultDir(), + mpt::PathString::FromNative(curDir) }; for(int i = 0; i < CountOf(dirs); i++) { m_InstrLibPath = dirs[i]; - if(!m_InstrLibPath.empty()) - { - break; - } else if(i == CountOf(dirs) - 1) - { - // Resort to current directory. - WCHAR curDir[MAX_PATH]; - GetCurrentDirectoryW(CountOf(curDir), curDir); - m_InstrLibPath = mpt::PathString::FromNative(curDir); - } + if(!m_InstrLibPath.empty()) break; } - if(!m_InstrLibPath.HasTrailingSlash()) - m_InstrLibPath += MPT_PATHSTRING("\\"); + m_InstrLibPath.EnsureTrailingSlash(); m_pDataTree->InsLibSetFullPath(m_InstrLibPath, mpt::PathString()); } @@ -355,7 +349,7 @@ //---------------------------------------------------------------- { mpt::PathString fullPath = m_InstrLibPath; - if(!fullPath.HasTrailingSlash()) fullPath += MPT_PATHSTRING("\\"); + fullPath.EnsureTrailingSlash(); return fullPath + mpt::PathString::FromCStringW(GetItemTextW(hItem)); } @@ -1358,8 +1352,7 @@ if(dlg.Show()) { mpt::PathString dir = dlg.GetDirectory(); - if(!dir.HasTrailingSlash()) - dir += MPT_PATHSTRING("\\"); + dir.EnsureTrailingSlash(); CMainFrame::GetMainFrame()->GetUpperTreeview()->InstrumentLibraryChDir(dir, false); } } @@ -2025,7 +2018,10 @@ { // Drives are formatted like "E:\", folders are just folder name without slash. if(!dir.HasTrailingSlash()) - dir = m_InstrLibPath + dir + MPT_PATHSTRING("\\"); + { + dir = m_InstrLibPath + dir; + dir.EnsureTrailingSlash(); + } m_InstrLibHighlightPath = MPT_PATHSTRING(".."); // Highlight first entry } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-06-05 20:13:58
|
Revision: 5254 http://sourceforge.net/p/modplug/code/5254 Author: manxorist Date: 2015-06-05 20:13:52 +0000 (Fri, 05 Jun 2015) Log Message: ----------- [Ref] The most common and useful case of mpt::String::Print is using it for our main string type, mpt::ustring. However this is the most tedious version to write: 'mpt::String::Print(MPT_USTRING("foo %1 %2"), bar, baz);'. Add a macro that simplifies this to 'MPT_UFORMAT("foo %1 %2", bar, baz);' which is way easier to type and read. MPT_FORMAT, MPT_WFORMAT and MPT_TFORMAT (for std::string, std::wstring and CString respectively) are also added. In order to support wide string literals depending on different compile time options, this has to be a variadic macro in these cases. Proper compiler feature selection macros are provided in CompilerDetect.h. The wide string versions are currently only required for OpenMPT builds and for libopenmpt MSVC builds. Existing users are not converted as there is no pressure to do so. Updating can be done gradually over time. Modified Paths: -------------- trunk/OpenMPT/common/CompilerDetect.h trunk/OpenMPT/common/mptStringFormat.h trunk/OpenMPT/test/test.cpp Modified: trunk/OpenMPT/common/CompilerDetect.h =================================================================== --- trunk/OpenMPT/common/CompilerDetect.h 2015-06-05 12:15:08 UTC (rev 5253) +++ trunk/OpenMPT/common/CompilerDetect.h 2015-06-05 20:13:52 UTC (rev 5254) @@ -202,10 +202,34 @@ #define MPT_COMPILER_HAS_RVALUE_REF 1 #endif #endif + #ifndef MPT_COMPILER_HAS_RVALUE_REF #define MPT_COMPILER_HAS_RVALUE_REF 0 #endif + +// C++11 includes variadic macros. +// C99 includes variadic macros. + +#if MPT_COMPILER_CLANG +#if MPT_CLANG_AT_LEAST(3,0,0) +#define MPT_COMPILER_HAS_VARIADIC_MACROS 1 +#endif +#elif MPT_COMPILER_MSVC +#if MPT_MSVC_AT_LEAST(2005,0) +#define MPT_COMPILER_HAS_VARIADIC_MACROS 1 +#endif +#elif MPT_COMPILER_GCC +#if MPT_GCC_AT_LEAST(3,0,0) +#define MPT_COMPILER_HAS_VARIADIC_MACROS 1 +#endif +#endif + +#ifndef MPT_COMPILER_HAS_VARIADIC_MACROS +#define MPT_COMPILER_HAS_VARIADIC_MACROS 0 +#endif + + #if MPT_MSVC_AT_LEAST(2010,0) || MPT_CLANG_AT_LEAST(3,0,0) || MPT_GCC_AT_LEAST(4,5,0) #define HAS_TYPE_TRAITS #endif Modified: trunk/OpenMPT/common/mptStringFormat.h =================================================================== --- trunk/OpenMPT/common/mptStringFormat.h 2015-06-05 12:15:08 UTC (rev 5253) +++ trunk/OpenMPT/common/mptStringFormat.h 2015-06-05 20:13:52 UTC (rev 5254) @@ -731,4 +731,44 @@ } } // namespace mpt::String +#if MPT_WSTRING_FORMAT || MPT_USTRING_MODE_WIDE || (defined(_MFC_VER) && defined(UNICODE)) +#if MPT_COMPILER_HAS_VARIADIC_MACROS +#define MPT_FORMAT_MACROS_VARIADIC 1 +#else +#error "Variadic macro support is required by MPT_FORMAT macros and it is unknown if your compiler supports those. Please tune CompilerSettings.h and/or BuildSettings.h and report an OpenMPT bug." +#endif +#else +#define MPT_FORMAT_MACROS_VARIADIC 0 +#endif + +#if MPT_FORMAT_MACROS_VARIADIC + +#define MPT_FORMAT( ... ) mpt::String::Print<std::string >( __VA_ARGS__ ) +#if MPT_WSTRING_FORMAT +#define MPT_WFORMAT( ... ) mpt::String::Print<std::wstring>( L ## __VA_ARGS__ ) +#endif +#if MPT_USTRING_MODE_WIDE +#define MPT_UFORMAT( ... ) mpt::String::Print<mpt::ustring>( L ## __VA_ARGS__ ) +#else +#define MPT_UFORMAT( ... ) mpt::String::Print<mpt::ustring>( __VA_ARGS__ ) +#endif +#if defined(_MFC_VER) +#ifdef UNICODE +#define MPT_TFORMAT( ... ) mpt::String::Print<CString >( L ## __VA_ARGS__ ) +#else +#define MPT_TFORMAT( ... ) mpt::String::Print<CString >( __VA_ARGS__ ) +#endif +#endif + +#else // !MPT_FORMAT_MACROS_VARIADIC + +#define MPT_FORMAT mpt::String::Print<std::string> +#define MPT_UFORMAT mpt::String::Print<mpt::ustring> +#if defined(_MFC_VER) +#define MPT_TFORMAT mpt::String::Print<CString> +#endif + +#endif // MPT_FORMAT_MACROS_VARIADIC + + OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/test/test.cpp =================================================================== --- trunk/OpenMPT/test/test.cpp 2015-06-05 12:15:08 UTC (rev 5253) +++ trunk/OpenMPT/test/test.cpp 2015-06-05 20:13:52 UTC (rev 5254) @@ -479,32 +479,32 @@ #endif // basic functionality - VERIFY_EQUAL(mpt::String::Print("%1%2%3",1,2,3), "123"); - VERIFY_EQUAL(mpt::String::Print("%1%1%1",1,2,3), "111"); - VERIFY_EQUAL(mpt::String::Print("%3%3%3",1,2,3), "333"); + VERIFY_EQUAL(MPT_FORMAT("%1%2%3",1,2,3), "123"); + VERIFY_EQUAL(MPT_FORMAT("%1%1%1",1,2,3), "111"); + VERIFY_EQUAL(MPT_FORMAT("%3%3%3",1,2,3), "333"); // template argument deduction of string type - VERIFY_EQUAL(mpt::String::Print(std::string("%1%2%3"),1,2,3), "123"); + VERIFY_EQUAL(MPT_FORMAT(std::string("%1%2%3"),1,2,3), "123"); #if MPT_WSTRING_FORMAT - VERIFY_EQUAL(mpt::String::Print(std::wstring(L"%1%2%3"),1,2,3), L"123"); - VERIFY_EQUAL(mpt::String::Print(L"%1%2%3",1,2,3), L"123"); + VERIFY_EQUAL(MPT_WFORMAT("%1%2%3",1,2,3), L"123"); + VERIFY_EQUAL(MPT_WFORMAT("%1%2%3",1,2,3), L"123"); #endif // escaping and error behviour of '%' - VERIFY_EQUAL(mpt::String::Print("%"), "%"); - VERIFY_EQUAL(mpt::String::Print("%%"), "%"); - VERIFY_EQUAL(mpt::String::Print("%%%"), "%%"); - VERIFY_EQUAL(mpt::String::Print("%1", "a"), "a"); - VERIFY_EQUAL(mpt::String::Print("%1%", "a"), "a%"); - VERIFY_EQUAL(mpt::String::Print("%1%%", "a"), "a%"); - VERIFY_EQUAL(mpt::String::Print("%1%%%", "a"), "a%%"); - VERIFY_EQUAL(mpt::String::Print("%%1", "a"), "%1"); - VERIFY_EQUAL(mpt::String::Print("%%%1", "a"), "%a"); - VERIFY_EQUAL(mpt::String::Print("%b", "a"), "%b"); + VERIFY_EQUAL(MPT_FORMAT("%"), "%"); + VERIFY_EQUAL(MPT_FORMAT("%%"), "%"); + VERIFY_EQUAL(MPT_FORMAT("%%%"), "%%"); + VERIFY_EQUAL(MPT_FORMAT("%1", "a"), "a"); + VERIFY_EQUAL(MPT_FORMAT("%1%", "a"), "a%"); + VERIFY_EQUAL(MPT_FORMAT("%1%%", "a"), "a%"); + VERIFY_EQUAL(MPT_FORMAT("%1%%%", "a"), "a%%"); + VERIFY_EQUAL(MPT_FORMAT("%%1", "a"), "%1"); + VERIFY_EQUAL(MPT_FORMAT("%%%1", "a"), "%a"); + VERIFY_EQUAL(MPT_FORMAT("%b", "a"), "%b"); #if defined(_MFC_VER) - VERIFY_EQUAL(mpt::String::Print(CString(_T("%1%2%3")),1,2,3), _T("123")); - VERIFY_EQUAL(mpt::String::Print(CString(_T("%1%2%3")),1,mpt::tfmt::dec0<3>(2),3), _T("10023")); + VERIFY_EQUAL(MPT_TFORMAT("%1%2%3",1,2,3), _T("123")); + VERIFY_EQUAL(MPT_TFORMAT("%1%2%3",1,mpt::tfmt::dec0<3>(2),3), _T("10023")); #endif } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-05 23:53:33
|
Revision: 5257 http://sourceforge.net/p/modplug/code/5257 Author: saga-games Date: 2015-06-05 23:53:25 +0000 (Fri, 05 Jun 2015) Log Message: ----------- [Fix] Since allowing several shortcuts to share the same keys, it was possible that shortcuts that switch between modules (e.g. open/close/prev doc/next doc) would regnerate the keymap and in the process also invalidate the multimap iterators, leading to OpenMPT doing weird things. [Fix] Pitch envelope was not actually applied during sample sync. [Mod] OpenMPT: Version is now 1.25.00.11 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2015-06-05 20:22:32 UTC (rev 5256) +++ trunk/OpenMPT/common/versionNumber.h 2015-06-05 23:53:25 UTC (rev 5257) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 25 #define VER_MINOR 00 -#define VER_MINORMINOR 10 +#define VER_MINORMINOR 11 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2015-06-05 20:22:32 UTC (rev 5256) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2015-06-05 23:53:25 UTC (rev 5257) @@ -9,15 +9,10 @@ #include "stdafx.h" -#include "afxtempl.h" #include "CommandSet.h" -#include "inputhandler.h" -#include "Resource.h" -#include "mptrack.h" -#include "mainfrm.h" -#include <direct.h> -#include ".\inputhandler.h" -#include <Shlwapi.h> +#include "InputHandler.h" +#include "resource.h" +#include "Mainfrm.h" OPENMPT_NAMESPACE_BEGIN @@ -87,6 +82,31 @@ } +static CommandID SendCommands(CWnd *wnd, const KeyMapRange &cmd, WPARAM wParam) +//----------------------------------------------------------------------------- +{ + CommandID executeCommand = kcNull; + if(wnd != nullptr) + { + std::vector<CommandID> commands; + commands.reserve(std::distance(cmd.first, cmd.second)); + for(KeyMap::const_iterator i = cmd.first; i != cmd.second; i++) + { + commands.push_back(i->second); + } + for(std::vector<CommandID>::const_iterator i = commands.begin(); i != commands.end(); i++) + { + if(wnd->SendMessage(WM_MOD_KEYCOMMAND, *i, wParam)) + { + // Command was handled, no need to let the OS handle it + executeCommand = *i; + } + } + } + return executeCommand; +} + + CommandID CInputHandler::GeneralKeyEvent(InputTargetContext context, int code, WPARAM wParam, LPARAM lParam) //---------------------------------------------------------------------------------------------------------- { @@ -128,21 +148,7 @@ cmd = keyMap.equal_range(KeyCombination(context, HOTKEYF_MIDI, wParam, kKeyEventDown)); } - CommandID executeCommand = kcNull; - if(m_pMainFrm) - { - for(KeyMap::const_iterator i = cmd.first; i != cmd.second; i++) - { - executeCommand = i->second; - if(!m_pMainFrm->SendMessage(WM_MOD_KEYCOMMAND, executeCommand, wParam)) - { - // Command was not handled, so let Windows process it. - return kcNull; - } - } - } - - return executeCommand; + return SendCommands(m_pMainFrm, cmd, wParam); } @@ -152,25 +158,10 @@ if(InterceptSpecialKeys(nChar, nFlags, false)) return kcNull; KeyMapRange cmd = keyMap.equal_range(KeyCombination(context, modifierMask, nChar, keyEventType)); - CommandID executeCommand = kcNull; if(pSourceWnd == nullptr) pSourceWnd = m_pMainFrm; //by default, send command message to main frame. - - if(pSourceWnd != nullptr) - { - for(KeyMap::const_iterator i = cmd.first; i != cmd.second; i++) - { - executeCommand = i->second; - if(!pSourceWnd->SendMessage(WM_MOD_KEYCOMMAND, executeCommand, nChar)) - { - // Command was not handled, so let Windows process it. - return kcNull; - } - } - } - - return executeCommand; + return SendCommands(pSourceWnd, cmd, nChar); } Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-06-05 20:22:32 UTC (rev 5256) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-06-05 23:53:25 UTC (rev 5257) @@ -104,6 +104,8 @@ const SmpLength sampleEnd = chn.dwFlags[CHN_LOOP] ? chn.nLoopEnd : chn.nLength; const SmpLength loopLength = chn.nLoopEnd - chn.nLoopStart; + const bool itEnvMode = sndFile.IsCompatibleMode(TRK_IMPULSETRACKER); + const bool updatePitchEnv = (chn.PitchEnv.flags & (ENV_ENABLED | ENV_FILTER)) == ENV_ENABLED; bool stopNote = false; int32 inc = chn.nInc * tickDuration; @@ -133,13 +135,20 @@ updateInc = true; } - sndFile.IncrementEnvelopePositions(&chn); + int period = chn.nPeriod; + if(itEnvMode) sndFile.IncrementEnvelopePositions(&chn); + if(updatePitchEnv) + { + sndFile.ProcessPitchFilterEnvelope(&chn, period); + updateInc = true; + } + if(!itEnvMode) sndFile.IncrementEnvelopePositions(&chn); int vol = 0; sndFile.ProcessInstrumentFade(&chn, vol); if(updateInc || chnSettings[channel].incChanged) { - chn.nInc = sndFile.GetChannelIncrement(&chn, chn.nPeriod, 0); + chn.nInc = sndFile.GetChannelIncrement(&chn, period, 0); chnSettings[channel].incChanged = false; inc = chn.nInc * tickDuration; if(chn.dwFlags[CHN_PINGPONGFLAG]) inc = -inc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-06 18:34:44
|
Revision: 5259 http://sourceforge.net/p/modplug/code/5259 Author: saga-games Date: 2015-06-06 18:34:38 +0000 (Sat, 06 Jun 2015) Log Message: ----------- [Mod] Song Cleanup: "Reset all variables" now also clears artist name. [Mod] Default keybindinds: New default shortcut Ctrl+Shift+C for Copy Orders [Doc] Steinberg slightly changed their developer page path again (old URL still works but redirects) Modified Paths: -------------- trunk/OpenMPT/README.md trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb Modified: trunk/OpenMPT/README.md =================================================================== --- trunk/OpenMPT/README.md 2015-06-06 15:40:21 UTC (rev 5258) +++ trunk/OpenMPT/README.md 2015-06-06 18:34:38 UTC (rev 5259) @@ -61,7 +61,7 @@ folder. Please visit - [steinberg.net](http://www.steinberg.net/en/company/developer.html) to + [steinberg.net](http://www.steinberg.net/en/company/developers.html) to download the SDK. - VST: @@ -77,7 +77,7 @@ have the old VST 2.4 SDK laying around, this should also work fine. Please visit - [steinberg.net](http://www.steinberg.net/en/company/developer.html) to + [steinberg.net](http://www.steinberg.net/en/company/developers.html) to download the SDK. Alternatively, both, the ASIO and the VST SDK, can be downloaded Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2015-06-06 15:40:21 UTC (rev 5258) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2015-06-06 18:34:38 UTC (rev 5259) @@ -813,6 +813,7 @@ // convert to IT... modDoc.ChangeModType(MOD_TYPE_IT); sndFile.SetMixLevels(mixLevelsCompatible); + sndFile.songArtist.clear(); sndFile.m_nTempoMode = tempoModeClassic; sndFile.m_SongFlags = SONG_LINEARSLIDES; sndFile.m_MidiCfg.Reset(); Modified: trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb =================================================================== --- trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2015-06-06 15:40:21 UTC (rev 5258) +++ trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2015-06-06 18:34:38 UTC (rev 5259) @@ -373,6 +373,7 @@ //----( Orderlist (19) )------------ 19:1802:0:46:5 //Delete Order: DELETE (KeyDown|KeyHold) 19:1803:0:45:5 //Insert Order: INSERT (KeyDown|KeyHold) +19:1950:3:67:1 //Copy Orders: Shift+Ctrl+C (KeyDown) 19:1804:0:13:5 //Edit Pattern: ENTER (KeyDown|KeyHold) 19:1805:0:9:5 //Switch to pattern editor: TAB (KeyDown|KeyHold) 19:1794:0:37:5 //Previous Order: LEFT (KeyDown|KeyHold) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-07 19:51:58
|
Revision: 5267 http://sourceforge.net/p/modplug/code/5267 Author: saga-games Date: 2015-06-07 19:51:52 +0000 (Sun, 07 Jun 2015) Log Message: ----------- [New] Added hidden settin VST Plugins.EnableAutoSuspend which activates plugin auto-suspension for all plugins (later, this will be configurable per plugin, hopefully). If a plugin didn't emit any sound during the last four seconds and no notes were triggered, its sound output is automatically suspended. [Fix] Plugin Bridge Hopefully fix a great bunch of deadlocked plugins by periodically processing window messages when waiting for the return value of a dispatch call. Modified Paths: -------------- trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/pluginBridge/Bridge.cpp trunk/OpenMPT/pluginBridge/BridgeWrapper.cpp trunk/OpenMPT/soundlib/plugins/PluginManager.cpp Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-06-07 19:38:01 UTC (rev 5266) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-06-07 19:51:52 UTC (rev 5267) @@ -247,6 +247,7 @@ , mruListLength(conf, "Misc", "MRUListLength", 10) // Plugins , bridgeAllPlugins(conf, "VST Plugins", "BridgeAllPlugins", false) + , enableAutoSuspend(conf, "VST Plugins", "EnableAutoSuspend", false) , DebugTraceEnable(conf, "Debug", "TraceEnable", false) , DebugTraceSize(conf, "Debug", "TraceSize", 1000000) , DebugTraceAlwaysDump(conf, "Debug", "TraceAlwaysDump", false) Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2015-06-07 19:38:01 UTC (rev 5266) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2015-06-07 19:51:52 UTC (rev 5267) @@ -595,6 +595,7 @@ // Plugins Setting<bool> bridgeAllPlugins; + Setting<bool> enableAutoSuspend; // Debug Modified: trunk/OpenMPT/pluginBridge/Bridge.cpp =================================================================== --- trunk/OpenMPT/pluginBridge/Bridge.cpp 2015-06-07 19:38:01 UTC (rev 5266) +++ trunk/OpenMPT/pluginBridge/Bridge.cpp 2015-06-07 19:51:52 UTC (rev 5267) @@ -10,11 +10,11 @@ // TODO // Translate VstIntPtr size in remaining structs!!! VstFileSelect, VstVariableIo, VstOfflineTask, VstAudioFile, VstWindow (all but VstFileSelect are currently not supported by OpenMPT) -// Fix Purity Demo GUI freeze more nicely // Optimize out audioMasterProcessEvents the same way as effProcessEvents? // Find a nice solution for audioMasterIdle that doesn't break TAL-Elek7ro-II // Maybe don't keep opening and closing aux mem files - but they are rarely needed, so would this actually be worth it? -// Kirnu GUI deadlocks +// Kirnu GUI deadlocks during playback +// jthalamus GUI crash // Low priority: // Speed up things like consecutive calls to CVstPlugin::GetFormattedProgramName by a custom opcode (is this necessary?) @@ -282,7 +282,20 @@ // Wait until the message thread notifies us. Signal &ackHandle = ackSignals[addr->header.signalID]; const HANDLE objects[] = { ackHandle.ack, ackHandle.send, otherProcess }; - result = WaitForMultipleObjects(CountOf(objects), objects, FALSE, INFINITE); + do + { + result = WaitForMultipleObjects(CountOf(objects), objects, FALSE, INFINITE); + if(result == WAIT_TIMEOUT) + { + MSG msg; + while(::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + continue; + } + } while (result == WAIT_TIMEOUT); addr->CopyFromSharedMemory(sendMsg); } @@ -516,22 +529,20 @@ TCHAR str[_MAX_PATH]; GetModuleFileName(library, str, CountOf(str)); + windowParent = reinterpret_cast<HWND>(msg->ptr); ptr = window = CreateWindow( WINDOWCLASSNAME, str, WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, 1, 1, + windowParent, NULL, - NULL, windowClass.hInstance, NULL); - windowParent = reinterpret_cast<HWND>(msg->ptr); - // ProteusVX and Dexed will freeze somewhere in a SetParent call if we do this before dispatching the message to the plugin. - // On the other hand, opening two shared KORG M1 editor instances makes the second instance crash the bridge if there is no parent. - if(nativeEffect->uniqueID == CCONST('K', 'L', 'M', '1')) - SetParent(window, windowParent); + // Opening two shared KORG M1 editor instances makes the second instance crash the bridge if there is no parent. + SetParent(window, windowParent); } break; @@ -659,11 +670,6 @@ break; case effEditOpen: - // Quick hack to get Purity demo to work (wants to show a message box during first effEditIdle call, this seems to fail after SetParent) - Dispatch(effEditIdle, 0, 0, nullptr, 0.0f); - - // Need to do this after creating. Otherwise, we'll freeze. We also need to do this after the open call, or else ProteusVX will freeze in a SetParent call. - SetParent(window, windowParent); SetProp(window, _T("MPT"), this); ShowWindow(window, SW_SHOW); break; Modified: trunk/OpenMPT/pluginBridge/BridgeWrapper.cpp =================================================================== --- trunk/OpenMPT/pluginBridge/BridgeWrapper.cpp 2015-06-07 19:38:01 UTC (rev 5266) +++ trunk/OpenMPT/pluginBridge/BridgeWrapper.cpp 2015-06-07 19:51:52 UTC (rev 5267) @@ -42,11 +42,11 @@ exeName = theApp.GetAppDirPath(); if(bitness == 32) { - exeName = exeName + MPT_PATHSTRING("PluginBridge32.exe"); + exeName += MPT_PATHSTRING("PluginBridge32.exe"); } if(bitness == 64) { - exeName = exeName + MPT_PATHSTRING("PluginBridge64.exe"); + exeName += MPT_PATHSTRING("PluginBridge64.exe"); } // First, check for validity of the bridge executable. if(!exeName.IsFile()) @@ -268,7 +268,7 @@ throw BridgeException("Could not initialize plugin bridge, it probably crashed."); } else if(initMsg.init.result != 1) { - throw BridgeException(mpt::ToLocale(initMsg.init.str).c_str()); + throw BridgeException(mpt::ToCharset(mpt::CharsetUTF8, initMsg.init.str).c_str()); } else { if(sharedMem->effect.flags & effFlagsCanReplacing) sharedMem->effect.processReplacing = ProcessReplacing; @@ -379,7 +379,19 @@ // Wait until the message thread notifies us. Signal &ackHandle = ackSignals[addr->header.signalID]; const HANDLE objects[] = { ackHandle.ack, ackHandle.send, otherProcess }; - result = WaitForMultipleObjects(CountOf(objects), objects, FALSE, INFINITE); + do + { + result = WaitForMultipleObjects(CountOf(objects), objects, FALSE, 100); + if(result == WAIT_TIMEOUT) + { + MSG msg; + while(::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + } + } while (result == WAIT_TIMEOUT); addr->CopyFromSharedMemory(sendMsg); // Bridge caught an exception while processing this request Modified: trunk/OpenMPT/soundlib/plugins/PluginManager.cpp =================================================================== --- trunk/OpenMPT/soundlib/plugins/PluginManager.cpp 2015-06-07 19:38:01 UTC (rev 5266) +++ trunk/OpenMPT/soundlib/plugins/PluginManager.cpp 2015-06-07 19:51:52 UTC (rev 5267) @@ -222,7 +222,7 @@ // If there was some error, don't try normal loading as well... unless the user really wants it. if(isNative) { - const std::wstring msg = L"The following error occured while trying to load\n" + plugin.dllPath.ToWide() + L"\n\n" + mpt::ToWide(mpt::CharsetLocale, e.what()) + const std::wstring msg = L"The following error occured while trying to load\n" + plugin.dllPath.ToWide() + L"\n\n" + mpt::ToWide(mpt::CharsetUTF8, e.what()) + L"\n\nDo you want to try to load the plugin natively?"; if(Reporting::Confirm(msg, L"OpenMPT Plugin Bridge") == cnfNo) { @@ -482,6 +482,7 @@ //----------------------------------------------------------------------------------- { VSTPluginLib *pFound = nullptr; + mixPlugin.SetAutoSuspend(TrackerSettings::Instance().enableAutoSuspend); // Find plugin in library int8 match = 0; // "Match quality" of found plugin. Higher value = better match. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-06-08 18:10:45
|
Revision: 5277 http://sourceforge.net/p/modplug/code/5277 Author: manxorist Date: 2015-06-08 18:10:35 +0000 (Mon, 08 Jun 2015) Log Message: ----------- [Ref] Make update check settings members of class TrackerSettings. Modified Paths: -------------- trunk/OpenMPT/common/mptTime.cpp trunk/OpenMPT/common/mptTime.h trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/common/mptTime.cpp =================================================================== --- trunk/OpenMPT/common/mptTime.cpp 2015-06-08 17:56:09 UTC (rev 5276) +++ trunk/OpenMPT/common/mptTime.cpp 2015-06-08 18:10:35 UTC (rev 5277) @@ -81,14 +81,31 @@ #endif // MODPLUG_TRACKER -namespace Unix +Unix::Unix() +//---------- + : Value(0) { + return; +} -time_t FromUTC(tm *timeUtc) +Unix::Unix(time_t unixtime) //------------------------- + : Value(unixtime) { + return; +} + +Unix::operator time_t () const +//---------------------------- +{ + return Value; +} + +mpt::Date::Unix Unix::FromUTC(tm timeUtc) +//--------------------------------------- +{ #if MPT_COMPILER_MSVC - return _mkgmtime(timeUtc); + return mpt::Date::Unix(_mkgmtime(&timeUtc)); #else // !MPT_COMPILER_MSVC // There is no portable way in C/C++ to convert between time_t and struct tm in UTC. // Approximate it as good as possible without implementing full date handling logic. @@ -96,31 +113,29 @@ // This can be wrong for dates during DST switch. if(!timeUtc) { - return time_t(); + return mpt::Date::Unix(time_t()); } tm t = *timeUtc; time_t localSinceEpoch = mktime(&t); const tm * tmpLocal = localtime(&localSinceEpoch); if(!tmpLocal) { - return localSinceEpoch; + return mpt::Date::Unix(localSinceEpoch); } tm localTM = *tmpLocal; const tm * tmpUTC = gmtime(&localSinceEpoch); if(!tmpUTC) { - return localSinceEpoch; + return mpt::Date::Unix(localSinceEpoch); } tm utcTM = *tmpUTC; double offset = difftime(mktime(&localTM), mktime(&utcTM)); double timeScaleFactor = difftime(2, 1); time_t utcSinceEpoch = localSinceEpoch + Util::Round<time_t>(offset / timeScaleFactor); - return utcSinceEpoch; + return mpt::Date::Unix(utcSinceEpoch); #endif // MPT_COMPILER_MSVC } -} // namespace Unix - mpt::ustring ToShortenedISO8601(tm date) //-------------------------------------- { Modified: trunk/OpenMPT/common/mptTime.h =================================================================== --- trunk/OpenMPT/common/mptTime.h 2015-06-08 17:56:09 UTC (rev 5276) +++ trunk/OpenMPT/common/mptTime.h 2015-06-08 18:10:35 UTC (rev 5277) @@ -42,14 +42,19 @@ #endif // MODPLUG_TRACKER -namespace Unix +class Unix { // time_t counts 1s since 1970-01-01T00:00Z +private: + time_t Value; +public: + Unix(); + explicit Unix(time_t unixtime); + operator time_t () const; +public: + static mpt::Date::Unix FromUTC(tm timeUtc); +}; -time_t FromUTC(tm *timeUtc); - -} // namespace Unix - mpt::ustring ToShortenedISO8601(tm date); // i.e. 2015-01-15T18:32:01Z } // namespace Date Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-06-08 17:56:09 UTC (rev 5276) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2015-06-08 18:10:35 UTC (rev 5277) @@ -254,6 +254,13 @@ // Plugins , bridgeAllPlugins(conf, "VST Plugins", "BridgeAllPlugins", false) , enableAutoSuspend(conf, "VST Plugins", "EnableAutoSuspend", false) + // Update + , UpdateLastUpdateCheck(conf, "Update", "LastUpdateCheck", mpt::Date::Unix(time_t())) + , UpdateUpdateCheckPeriod(conf, "Update", "UpdateCheckPeriod", CUpdateCheck::GetUpdateCheckPeriod()) + , UpdateUpdateURL(conf, "Update", "UpdateURL", CUpdateCheck::GetUpdateURL()) + , UpdateSendGUID(conf, "Update", "SendGUID", CUpdateCheck::GetSendGUID()) + , UpdateShowUpdateHint(conf, "Update", "ShowUpdateHint", CUpdateCheck::GetShowUpdateHint()) + // Debug , DebugTraceEnable(conf, "Debug", "TraceEnable", false) , DebugTraceSize(conf, "Debug", "TraceSize", 1000000) , DebugTraceAlwaysDump(conf, "Debug", "TraceAlwaysDump", false) @@ -337,26 +344,7 @@ PatternClipboard::SetClipboardSize(conf.Read<int32>("Pattern Editor", "NumClipboards", mpt::saturate_cast<int32>(PatternClipboard::GetClipboardSize()))); // Update - { - tm lastUpdate; - MemsetZero(lastUpdate); - std::string s = conf.Read<std::string>("Update", "LastUpdateCheck", "1970-01-01 00:00"); - if(sscanf(s.c_str(), "%04d-%02d-%02d %02d:%02d", &lastUpdate.tm_year, &lastUpdate.tm_mon, &lastUpdate.tm_mday, &lastUpdate.tm_hour, &lastUpdate.tm_min) == 5) - { - lastUpdate.tm_year -= 1900; - lastUpdate.tm_mon--; - } - time_t outTime = mpt::Date::Unix::FromUTC(&lastUpdate); - if(outTime < 0) outTime = 0; - CUpdateCheck::SetUpdateSettings - ( - outTime, - conf.Read<int32>("Update", "UpdateCheckPeriod", CUpdateCheck::GetUpdateCheckPeriod()), - conf.Read<CString>("Update", "UpdateURL", CUpdateCheck::GetUpdateURL()), - conf.Read<int32>("Update", "SendGUID", CUpdateCheck::GetSendGUID() ? 1 : 0) != 0, - conf.Read<int32>("Update", "ShowUpdateHint", CUpdateCheck::GetShowUpdateHint() ? 1 : 0) != 0 - ); - } + CUpdateCheck::SetUpdateSettings(UpdateLastUpdateCheck.Get(), UpdateUpdateCheckPeriod, UpdateUpdateURL, UpdateSendGUID, UpdateShowUpdateHint); // Chords LoadChords(Chords); @@ -847,20 +835,13 @@ conf.Write<int32>("Pattern Editor", "NumClipboards", mpt::saturate_cast<int32>(PatternClipboard::GetClipboardSize())); - // Internet Update + // Update { - CString outDate; - const time_t t = CUpdateCheck::GetLastUpdateCheck(); - const tm* const lastUpdate = gmtime(&t); - if(lastUpdate != nullptr) - { - outDate.Format(_T("%04d-%02d-%02d %02d:%02d"), lastUpdate->tm_year + 1900, lastUpdate->tm_mon + 1, lastUpdate->tm_mday, lastUpdate->tm_hour, lastUpdate->tm_min); - } - conf.Write<CString>("Update", "LastUpdateCheck", outDate); - conf.Write<int32>("Update", "UpdateCheckPeriod", CUpdateCheck::GetUpdateCheckPeriod()); - conf.Write<CString>("Update", "UpdateURL", CUpdateCheck::GetUpdateURL()); - conf.Write<int32>("Update", "SendGUID", CUpdateCheck::GetSendGUID() ? 1 : 0); - conf.Write<int32>("Update", "ShowUpdateHint", CUpdateCheck::GetShowUpdateHint() ? 1 : 0); + UpdateLastUpdateCheck = mpt::Date::Unix(CUpdateCheck::GetLastUpdateCheck()); + UpdateUpdateCheckPeriod = CUpdateCheck::GetUpdateCheckPeriod(); + UpdateUpdateURL = CUpdateCheck::GetUpdateURL(); + UpdateSendGUID = CUpdateCheck::GetSendGUID(); + UpdateShowUpdateHint = CUpdateCheck::GetShowUpdateHint(); } // Effects Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2015-06-08 17:56:09 UTC (rev 5276) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2015-06-08 18:10:35 UTC (rev 5277) @@ -320,6 +320,36 @@ return static_cast<SoundDeviceStopMode>(static_cast<int32>(val)); } +template<> inline SettingValue ToSettingValue(const mpt::Date::Unix &val) +{ + time_t t = val; + const tm* lastUpdate = gmtime(&t); + CString outDate; + if(lastUpdate) + { + outDate.Format(_T("%04d-%02d-%02d %02d:%02d"), lastUpdate->tm_year + 1900, lastUpdate->tm_mon + 1, lastUpdate->tm_mday, lastUpdate->tm_hour, lastUpdate->tm_min); + } + return SettingValue(outDate, "UTC"); +} +template<> inline mpt::Date::Unix FromSettingValue(const SettingValue &val) +{ + MPT_ASSERT(val.GetTypeTag() == "UTC"); + std::string s = val.as<std::string>(); + tm lastUpdate; + MemsetZero(lastUpdate); + if(sscanf(s.c_str(), "%04d-%02d-%02d %02d:%02d", &lastUpdate.tm_year, &lastUpdate.tm_mon, &lastUpdate.tm_mday, &lastUpdate.tm_hour, &lastUpdate.tm_min) == 5) + { + lastUpdate.tm_year -= 1900; + lastUpdate.tm_mon--; + } + time_t outTime = mpt::Date::Unix::FromUTC(lastUpdate); + if(outTime < 0) + { + outTime = 0; + } + return mpt::Date::Unix(outTime); +} + struct FontSetting { enum FontFlags @@ -447,7 +477,6 @@ Setting<FontSetting> commentsFont; - // Misc Setting<bool> ShowSettingsOnNewVersion; @@ -605,6 +634,14 @@ Setting<bool> bridgeAllPlugins; Setting<bool> enableAutoSuspend; + // Update + + Setting<mpt::Date::Unix> UpdateLastUpdateCheck; + Setting<int32> UpdateUpdateCheckPeriod; + Setting<CString> UpdateUpdateURL; + Setting<bool> UpdateSendGUID; + Setting<bool> UpdateShowUpdateHint; + // Debug Setting<bool> DebugTraceEnable; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2015-06-08 17:56:09 UTC (rev 5276) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2015-06-08 18:10:35 UTC (rev 5277) @@ -48,7 +48,7 @@ // Calculate the date when editing finished. double openSeconds = (double)openTime / (double)HISTORY_TIMER_PRECISION; tm tmpLoadDate = loadDate; - time_t loadDateSinceEpoch = mpt::Date::Unix::FromUTC(&tmpLoadDate); + time_t loadDateSinceEpoch = mpt::Date::Unix::FromUTC(tmpLoadDate); double timeScaleFactor = difftime(2, 1); time_t saveDateSinceEpoch = loadDateSinceEpoch + Util::Round<time_t>(openSeconds / timeScaleFactor); const tm * tmpSaveDate = gmtime(&saveDateSinceEpoch); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-09 17:44:42
|
Revision: 5284 http://sourceforge.net/p/modplug/code/5284 Author: saga-games Date: 2015-06-09 17:44:35 +0000 (Tue, 09 Jun 2015) Log Message: ----------- [New] Tremor (Ixx) is now also supported for instrument plugins (http://forum.openmpt.org/index.php?topic=2736.0). [Fix] The plugin selection dialog was not placed correctly on multi-monitor setups or after moving a windowed OpenMPT instance. [Mod] OpenMPT: Version is now 1.25.00.12 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/SelectPluginDialog.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2015-06-09 09:23:11 UTC (rev 5283) +++ trunk/OpenMPT/common/versionNumber.h 2015-06-09 17:44:35 UTC (rev 5284) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 25 #define VER_MINOR 00 -#define VER_MINORMINOR 11 +#define VER_MINORMINOR 12 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2015-06-09 09:23:11 UTC (rev 5283) +++ trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2015-06-09 17:44:35 UTC (rev 5284) @@ -94,7 +94,7 @@ if (m_pPlugin) { CString targetSlot; - targetSlot.Format(_T("&Put in FX%02d"), m_nPlugSlot + 1); + targetSlot.Format(_T("&Put in FX%02u"), m_nPlugSlot + 1); SetDlgItemText(IDOK, targetSlot); ::EnableWindow(::GetDlgItem(m_hWnd, IDOK), TRUE); } else @@ -104,10 +104,13 @@ const int dpiX = Util::GetDPIx(m_hWnd); const int dpiY = Util::GetDPIy(m_hWnd); - MoveWindow(MulDiv(TrackerSettings::Instance().gnPlugWindowX, dpiX, 96), - MulDiv(TrackerSettings::Instance().gnPlugWindowY, dpiY, 96), - MulDiv(TrackerSettings::Instance().gnPlugWindowWidth, dpiX, 96), - MulDiv(TrackerSettings::Instance().gnPlugWindowHeight, dpiY, 96)); + CRect rect + ( + CPoint(MulDiv(TrackerSettings::Instance().gnPlugWindowX, dpiX, 96), MulDiv(TrackerSettings::Instance().gnPlugWindowY, dpiY, 96)), + CSize(MulDiv(TrackerSettings::Instance().gnPlugWindowWidth, dpiX, 96), MulDiv(TrackerSettings::Instance().gnPlugWindowHeight, dpiY, 96)) + ); + ::MapWindowPoints(GetParent()->m_hWnd, HWND_DESKTOP, (CPoint *)&rect, 2); + MoveWindow(rect); UpdatePluginsList(); OnSelChanged(NULL, NULL); @@ -220,6 +223,7 @@ { CRect rect; GetWindowRect(&rect); + ::MapWindowPoints(HWND_DESKTOP, GetParent()->m_hWnd, (CPoint *)&rect, 2); const int dpiX = Util::GetDPIx(m_hWnd); const int dpiY = Util::GetDPIy(m_hWnd); TrackerSettings::Instance().gnPlugWindowX = MulDiv(rect.left, 96, dpiX); Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2015-06-09 09:23:11 UTC (rev 5283) +++ trunk/OpenMPT/soundlib/Sndfile.h 2015-06-09 17:44:35 UTC (rev 5284) @@ -405,7 +405,7 @@ CHANNELINDEX m_nChannels; SAMPLEINDEX m_nSamples; INSTRUMENTINDEX m_nInstruments; - UINT m_nDefaultSpeed, m_nDefaultGlobalVolume; + uint32 m_nDefaultSpeed, m_nDefaultGlobalVolume; TEMPO m_nDefaultTempo; FlagSet<SongFlags> m_SongFlags; CHANNELINDEX m_nMixChannels; @@ -421,11 +421,11 @@ ORDERINDEX m_lockOrderStart, m_lockOrderEnd; #endif // MODPLUG_TRACKER - UINT m_nSamplePreAmp, m_nVSTiVolume; + uint32 m_nSamplePreAmp, m_nVSTiVolume; bool IsGlobalVolumeUnset() const { return IsFirstTick(); } #ifndef MODPLUG_TRACKER - UINT m_nFreqFactor; // Pitch shift factor (65536 = no pitch shifting). Only used in libopenmpt (openmpt::ext::interactive::set_pitch_factor) - UINT m_nTempoFactor; // Tempo factor (65536 = no tempo adjustment). Only used in libopenmpt (openmpt::ext::interactive::set_tempo_factor) + uint32 m_nFreqFactor; // Pitch shift factor (65536 = no pitch shifting). Only used in libopenmpt (openmpt::ext::interactive::set_pitch_factor) + uint32 m_nTempoFactor; // Tempo factor (65536 = no tempo adjustment). Only used in libopenmpt (openmpt::ext::interactive::set_tempo_factor) #endif // Min Period = highest possible frequency, Max Period = lowest possible frequency for current format @@ -800,7 +800,7 @@ void ProcessVolumeSwing(ModChannel *pChn, int &vol) const; void ProcessPanningSwing(ModChannel *pChn) const; void ProcessTremolo(ModChannel *pChn, int &vol) const; - void ProcessTremor(ModChannel *pChn, int &vol) const; + void ProcessTremor(CHANNELINDEX nChn, int &vol); bool IsEnvelopeProcessed(const ModChannel *pChn, EnvelopeType env) const; void ProcessVolumeEnvelope(ModChannel *pChn, int &vol) const; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2015-06-09 09:23:11 UTC (rev 5283) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2015-06-09 17:44:35 UTC (rev 5284) @@ -766,71 +766,73 @@ } -void CSoundFile::ProcessTremor(ModChannel *pChn, int &vol) const -//-------------------------------------------------------------- +void CSoundFile::ProcessTremor(CHANNELINDEX nChn, int &vol) +//--------------------------------------------------------- { + ModChannel &chn = m_PlayState.Chn[nChn]; + if(IsCompatibleMode(TRK_FASTTRACKER2)) { // FT2 Compatibility: Weird XM tremor. // Test case: Tremor.xm - if(pChn->nTremorCount & 0x80) + if(chn.nTremorCount & 0x80) { - if(!m_SongFlags[SONG_FIRSTTICK] && pChn->nCommand == CMD_TREMOR) + if(!m_SongFlags[SONG_FIRSTTICK] && chn.nCommand == CMD_TREMOR) { - pChn->nTremorCount &= ~0x20; - if(pChn->nTremorCount == 0x80) + chn.nTremorCount &= ~0x20; + if(chn.nTremorCount == 0x80) { // Reached end of off-time - pChn->nTremorCount = (pChn->nTremorParam >> 4) | 0xC0; - } else if(pChn->nTremorCount == 0xC0) + chn.nTremorCount = (chn.nTremorParam >> 4) | 0xC0; + } else if(chn.nTremorCount == 0xC0) { // Reached end of on-time - pChn->nTremorCount = (pChn->nTremorParam & 0x0F) | 0x80; + chn.nTremorCount = (chn.nTremorParam & 0x0F) | 0x80; } else { - pChn->nTremorCount--; + chn.nTremorCount--; } - pChn->dwFlags.set(CHN_FASTVOLRAMP); + chn.dwFlags.set(CHN_FASTVOLRAMP); } - if((pChn->nTremorCount & 0xE0) == 0x80) + if((chn.nTremorCount & 0xE0) == 0x80) { vol = 0; } } - } else if(pChn->nCommand == CMD_TREMOR) + } else if(chn.nCommand == CMD_TREMOR) { // IT compatibility 12. / 13.: Tremor if(IsCompatibleMode(TRK_IMPULSETRACKER)) { - if((pChn->nTremorCount & 0x80) && pChn->nLength) + if((chn.nTremorCount & 0x80) && chn.nLength) { - if (pChn->nTremorCount == 0x80) - pChn->nTremorCount = (pChn->nTremorParam >> 4) | 0xC0; - else if (pChn->nTremorCount == 0xC0) - pChn->nTremorCount = (pChn->nTremorParam & 0x0F) | 0x80; + if (chn.nTremorCount == 0x80) + chn.nTremorCount = (chn.nTremorParam >> 4) | 0xC0; + else if (chn.nTremorCount == 0xC0) + chn.nTremorCount = (chn.nTremorParam & 0x0F) | 0x80; else - pChn->nTremorCount--; + chn.nTremorCount--; } - if((pChn->nTremorCount & 0xC0) == 0x80) + if((chn.nTremorCount & 0xC0) == 0x80) vol = 0; } else { - uint8 ontime = pChn->nTremorParam >> 4; - uint8 n = ontime + (pChn->nTremorParam & 0x0F); // Total tremor cycle time (On + Off) + uint8 ontime = chn.nTremorParam >> 4; + uint8 n = ontime + (chn.nTremorParam & 0x0F); // Total tremor cycle time (On + Off) if ((!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) || m_SongFlags[SONG_ITOLDEFFECTS]) { n += 2; ontime++; } - uint8 tremcount = pChn->nTremorCount; + uint8 tremcount = chn.nTremorCount; if(!(GetType() & MOD_TYPE_XM)) { if (tremcount >= n) tremcount = 0; if (tremcount >= ontime) vol = 0; - pChn->nTremorCount = tremcount + 1; + chn.nTremorCount = tremcount + 1; } else { if(m_SongFlags[SONG_FIRSTTICK]) @@ -842,13 +844,34 @@ } } else { - pChn->nTremorCount = tremcount + 1; + chn.nTremorCount = tremcount + 1; } if (tremcount % n >= ontime) vol = 0; } } - pChn->dwFlags.set(CHN_FASTVOLRAMP); + chn.dwFlags.set(CHN_FASTVOLRAMP); } + +#ifndef NO_VST + // Plugin tremor + if(chn.nCommand == CMD_TREMOR && chn.pModInstrument && chn.pModInstrument->nMixPlug + && !chn.pModInstrument->dwFlags[INS_MUTE] + && !chn.dwFlags[CHN_MUTE | CHN_SYNCMUTE] + && ModCommand::IsNote(chn.nLastNote)) + { + const ModInstrument *pIns = chn.pModInstrument; + IMixPlugin *pPlugin = m_MixPlugins[pIns->nMixPlug - 1].pMixPlugin; + if(pPlugin) + { + uint8 midiChn = GetBestMidiChannel(nChn); + bool isPlaying = pPlugin->isPlaying(chn.nLastNote, midiChn, nChn); + if(vol == 0 && isPlaying) + pPlugin->MidiCommand(midiChn, pIns->nMidiProgram, pIns->wMidiBank, chn.nLastNote + NOTE_MAX_SPECIAL, 0, nChn); + else if(vol != 0 && !isPlaying) + pPlugin->MidiCommand(midiChn, pIns->nMidiProgram, pIns->wMidiBank, chn.nLastNote, static_cast<uint16>(chn.nVolume), nChn); + } + } +#endif // NO_VST } @@ -1862,7 +1885,7 @@ ProcessVolumeSwing(pChn, IsCompatibleMode(TRK_IMPULSETRACKER) ? insVol : vol); ProcessPanningSwing(pChn); ProcessTremolo(pChn, vol); - ProcessTremor(pChn, vol); + ProcessTremor(nChn, vol); // Clip volume and multiply (extend to 14 bits) Limit(vol, 0, 256); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-09 20:36:49
|
Revision: 5286 http://sourceforge.net/p/modplug/code/5286 Author: saga-games Date: 2015-06-09 20:36:42 +0000 (Tue, 09 Jun 2015) Log Message: ----------- [Fix] Avoid crashes when VST calls IO change opcode (possibly introduced with recent message dispatching code, but could have happened at any time before as well) Modified Paths: -------------- trunk/OpenMPT/build/premake/mpt-PluginBridge.lua trunk/OpenMPT/build/vs2008/PluginBridge.vcproj trunk/OpenMPT/build/vs2010/PluginBridge.vcxproj trunk/OpenMPT/build/vs2012/PluginBridge.vcxproj trunk/OpenMPT/build/vs2013/PluginBridge.vcxproj trunk/OpenMPT/build/vs2015/PluginBridge.vcxproj trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/pluginBridge/AEffectWrapper.h trunk/OpenMPT/pluginBridge/Bridge.cpp trunk/OpenMPT/pluginBridge/BridgeCommon.h trunk/OpenMPT/pluginBridge/BridgeWrapper.cpp trunk/OpenMPT/pluginBridge/BridgeWrapper.h trunk/OpenMPT/pluginBridge/PluginBridge.vcxproj trunk/OpenMPT/pluginBridge/PluginBridge.vcxproj.filters Added Paths: ----------- trunk/OpenMPT/pluginBridge/BridgeOpCodes.h Modified: trunk/OpenMPT/build/premake/mpt-PluginBridge.lua =================================================================== --- trunk/OpenMPT/build/premake/mpt-PluginBridge.lua 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/build/premake/mpt-PluginBridge.lua 2015-06-09 20:36:42 UTC (rev 5286) @@ -15,6 +15,7 @@ "../../pluginBridge/Bridge.cpp", "../../pluginBridge/Bridge.h", "../../pluginBridge/BridgeCommon.h", + "../../pluginBridge/BridgeOpCodes.h", "../../pluginBridge/PluginBridge.rc", } defines { "MODPLUG_TRACKER" } Modified: trunk/OpenMPT/build/vs2008/PluginBridge.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/PluginBridge.vcproj 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/build/vs2008/PluginBridge.vcproj 2015-06-09 20:36:42 UTC (rev 5286) @@ -706,6 +706,10 @@ > </File> <File + RelativePath="..\..\pluginBridge\BridgeOpCodes.h" + > + </File> + <File RelativePath="..\..\pluginBridge\PluginBridge.rc" > </File> Modified: trunk/OpenMPT/build/vs2010/PluginBridge.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2010/PluginBridge.vcxproj 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/build/vs2010/PluginBridge.vcxproj 2015-06-09 20:36:42 UTC (rev 5286) @@ -432,6 +432,7 @@ <ClInclude Include="..\..\pluginBridge\AEffectWrapper.h" /> <ClInclude Include="..\..\pluginBridge\Bridge.h" /> <ClInclude Include="..\..\pluginBridge\BridgeCommon.h" /> + <ClInclude Include="..\..\pluginBridge\BridgeOpCodes.h" /> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\pluginBridge\Bridge.cpp" /> Modified: trunk/OpenMPT/build/vs2012/PluginBridge.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2012/PluginBridge.vcxproj 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/build/vs2012/PluginBridge.vcxproj 2015-06-09 20:36:42 UTC (rev 5286) @@ -440,6 +440,7 @@ <ClInclude Include="..\..\pluginBridge\AEffectWrapper.h" /> <ClInclude Include="..\..\pluginBridge\Bridge.h" /> <ClInclude Include="..\..\pluginBridge\BridgeCommon.h" /> + <ClInclude Include="..\..\pluginBridge\BridgeOpCodes.h" /> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\pluginBridge\Bridge.cpp" /> Modified: trunk/OpenMPT/build/vs2013/PluginBridge.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2013/PluginBridge.vcxproj 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/build/vs2013/PluginBridge.vcxproj 2015-06-09 20:36:42 UTC (rev 5286) @@ -441,6 +441,7 @@ <ClInclude Include="..\..\pluginBridge\AEffectWrapper.h" /> <ClInclude Include="..\..\pluginBridge\Bridge.h" /> <ClInclude Include="..\..\pluginBridge\BridgeCommon.h" /> + <ClInclude Include="..\..\pluginBridge\BridgeOpCodes.h" /> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\pluginBridge\Bridge.cpp" /> Modified: trunk/OpenMPT/build/vs2015/PluginBridge.vcxproj =================================================================== --- trunk/OpenMPT/build/vs2015/PluginBridge.vcxproj 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/build/vs2015/PluginBridge.vcxproj 2015-06-09 20:36:42 UTC (rev 5286) @@ -441,6 +441,7 @@ <ClInclude Include="..\..\pluginBridge\AEffectWrapper.h" /> <ClInclude Include="..\..\pluginBridge\Bridge.h" /> <ClInclude Include="..\..\pluginBridge\BridgeCommon.h" /> + <ClInclude Include="..\..\pluginBridge\BridgeOpCodes.h" /> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\pluginBridge\Bridge.cpp" /> Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2015-06-09 20:36:42 UTC (rev 5286) @@ -26,6 +26,7 @@ #include "../common/mptFileIO.h" #include "../common/FileReader.h" #include "FileDialog.h" +#include "../pluginBridge/BridgeOpCodes.h" #include "../soundlib/plugins/OpCodes.h" #include "../soundlib/mod_specifications.h" @@ -165,7 +166,8 @@ // Time signature. numerator = rows per beats / rows pear measure (should sound somewhat logical to you). // the denominator is a bit more tricky, since it cannot be set explicitely. so we just assume quarters for now. - timeInfo.timeSigNumerator = sndFile.m_PlayState.m_nCurrentRowsPerMeasure / std::max(sndFile.m_PlayState.m_nCurrentRowsPerBeat, ROWINDEX(1)); + ROWINDEX rpb = std::max(sndFile.m_PlayState.m_nCurrentRowsPerBeat, ROWINDEX(1)); + timeInfo.timeSigNumerator = std::max(sndFile.m_PlayState.m_nCurrentRowsPerMeasure, rpb) / rpb; timeInfo.timeSigDenominator = 4; //gcd(pSndFile->m_nCurrentRowsPerMeasure, pSndFile->m_nCurrentRowsPerBeat); } } @@ -1154,11 +1156,11 @@ CString formattedName; if((unsigned char)rawname[0] < ' ') { - formattedName.Format("%02d - Program %d", index, index); + formattedName.Format("%02u - Program %u", index, index); } else { - formattedName.Format("%02d - %s", index, rawname); + formattedName.Format("%02u - %s", index, rawname); } return formattedName; @@ -1194,14 +1196,8 @@ //CVstPluginManager::ReportPlugException("Exception in getParameter (Plugin=\"%s\")!\n", m_Factory.szLibraryName); } } - //rewbs.VSTcompliance - if (fResult<0.0f) - return 0.0f; - else if (fResult>1.0f) - return 1.0f; - else - //end rewbs.VSTcompliance - return fResult; + Limit(fResult, 0.0f, 1.0f); + return fResult; } @@ -1482,15 +1478,15 @@ // If the plug is found & ok, continue if(m_pProcessFP != nullptr && (mixBuffer.GetInputBufferArray()) && mixBuffer.GetOutputBufferArray() && m_pMixStruct != nullptr) { - + VstInt32 numInputs = m_Effect.numInputs, numOutputs = m_Effect.numOutputs; //RecalculateGain(); // Merge stereo input before sending to the plug if the plug can only handle one input. - if (m_Effect.numInputs == 1) + if (numInputs == 1) { for (size_t i = 0; i < nSamples; i++) { - m_MixState.pOutBufferL[i] = 0.5f * m_MixState.pOutBufferL[i] + 0.5f * m_MixState.pOutBufferR[i]; + m_MixState.pOutBufferL[i] = 0.5f * (m_MixState.pOutBufferL[i] + m_MixState.pOutBufferR[i]); } } @@ -1515,15 +1511,15 @@ ASSERT(outputBuffers != nullptr); // Mix outputs of multi-output VSTs: - if(m_Effect.numOutputs > 2) + if(numOutputs > 2) { // first, mix extra outputs on a stereo basis - VstInt32 numOutputs = m_Effect.numOutputs; + VstInt32 outs = numOutputs; // so if nOuts is not even, let process the last output later - if((numOutputs % 2u) == 1) numOutputs--; + if((outs % 2u) == 1) outs--; // mix extra stereo outputs - for(VstInt32 iOut = 2; iOut < numOutputs; iOut++) + for(VstInt32 iOut = 2; iOut < outs; iOut++) { for(size_t i = 0; i < nSamples; i++) { @@ -1532,21 +1528,21 @@ } // if m_Effect.numOutputs is odd, mix half the signal of last output to each channel - if(numOutputs != m_Effect.numOutputs) + if(outs != numOutputs) { // trick : if we are here, numOutputs = m_Effect.numOutputs - 1 !!! for(size_t i = 0; i < nSamples; i++) { - float v = 0.5f * outputBuffers[numOutputs][i]; + float v = 0.5f * outputBuffers[outs][i]; outputBuffers[0][i] += v; outputBuffers[1][i] += v; } } } - if(m_Effect.numOutputs != 0) + if(numOutputs != 0) { - ProcessMixOps(pOutL, pOutR, outputBuffers[0], outputBuffers[m_Effect.numOutputs > 1 ? 1 : 0], nSamples); + ProcessMixOps(pOutL, pOutR, outputBuffers[0], outputBuffers[numOutputs > 1 ? 1 : 0], nSamples); } // If dry mix is ticked, we add the unprocessed buffer, @@ -1559,6 +1555,12 @@ pOutR[i] += m_MixState.pOutBufferR[i]; } } + + // If the I/O format of the bridge changed in the meanwhile, update it now. + if(isBridged && Dispatch(effVendorSpecific, kVendorOpenMPT, kCloseOldProcessingMemory, nullptr, 0.0f) != 0) + { + InitializeIOBuffers(); + } } vstEvents.Clear(); @@ -2018,6 +2020,7 @@ pModDoc->RecordParamChange(GetSlot(), param); } + // TODO: This should rather be posted to the GUI thread! CAbstractVstEditor *pVstEditor = GetEditor(); if(pVstEditor && pVstEditor->m_hWnd) Modified: trunk/OpenMPT/pluginBridge/AEffectWrapper.h =================================================================== --- trunk/OpenMPT/pluginBridge/AEffectWrapper.h 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/pluginBridge/AEffectWrapper.h 2015-06-09 20:36:42 UTC (rev 5286) @@ -94,17 +94,6 @@ #pragma pack(pop) -enum VendorSpecificOpCodes -{ - kUpdateEffectStruct = 0, - kUpdateProcessingBuffer, - kGetWrapperPointer, - kUpdateEventMemName, - - kVendorOpenMPT = CCONST('O', 'M', 'P', 'T'), -}; - - // Translate a VSTEvents struct to bridge format (placed in data vector) static void TranslateVSTEventsToBridge(std::vector<char> &data, const VstEvents *events, int32_t targetPtrSize) { Modified: trunk/OpenMPT/pluginBridge/Bridge.cpp =================================================================== --- trunk/OpenMPT/pluginBridge/Bridge.cpp 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/pluginBridge/Bridge.cpp 2015-06-09 20:36:42 UTC (rev 5286) @@ -13,7 +13,7 @@ // Optimize out audioMasterProcessEvents the same way as effProcessEvents? // Find a nice solution for audioMasterIdle that doesn't break TAL-Elek7ro-II // Maybe don't keep opening and closing aux mem files - but they are rarely needed, so would this actually be worth it? -// Kirnu GUI deadlocks during playback +// Kirnu and Combo F GUI deadlocks during playback // Low priority: // Speed up things like consecutive calls to CVstPlugin::GetFormattedProgramName by a custom opcode (is this necessary?) @@ -934,7 +934,7 @@ MPT_FALLTHROUGH; case audioMasterIOChanged: // We need to be sure that the new values are known to the master. - if(!processing && nativeEffect != nullptr) + if(nativeEffect != nullptr) { UpdateEffectStruct(); CreateProcessingFile(dispatchData); Modified: trunk/OpenMPT/pluginBridge/BridgeCommon.h =================================================================== --- trunk/OpenMPT/pluginBridge/BridgeCommon.h 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/pluginBridge/BridgeCommon.h 2015-06-09 20:36:42 UTC (rev 5286) @@ -27,6 +27,7 @@ } #include "AEffectWrapper.h" +#include "BridgeOpCodes.h" #include "../common/thread.h" @@ -182,6 +183,16 @@ } bool Good() const { return view != nullptr; } + + // Make a copy and detach it from the other object + void CopyFrom(MappedMemory &other) + { + Close(); + mapFile = other.mapFile; + view = other.view; + other.mapFile = nullptr; + other.view = nullptr; + } }; Added: trunk/OpenMPT/pluginBridge/BridgeOpCodes.h =================================================================== --- trunk/OpenMPT/pluginBridge/BridgeOpCodes.h (rev 0) +++ trunk/OpenMPT/pluginBridge/BridgeOpCodes.h 2015-06-09 20:36:42 UTC (rev 5286) @@ -0,0 +1,25 @@ +/* + * BridgeOpCodes.h + * --------------- + * Purpose: Various dispatch opcodes for communication between OpenMPT and its plugin bridge. + * Notes : (currently none) + * Authors: Johannes Schultz (OpenMPT Devs) + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#pragma once + +#define VST_FORCE_DEPRECATED 0 +#include "../include/vstsdk2.4/pluginterfaces/vst2.x/aeffectx.h" + +enum VendorSpecificOpCodes +{ + kUpdateEffectStruct = 0, + kUpdateProcessingBuffer, + kGetWrapperPointer, + kUpdateEventMemName, + kCloseOldProcessingMemory, + + kVendorOpenMPT = CCONST('O', 'M', 'P', 'T'), +}; Property changes on: trunk/OpenMPT/pluginBridge/BridgeOpCodes.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-chdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/OpenMPT/pluginBridge/BridgeWrapper.cpp =================================================================== --- trunk/OpenMPT/pluginBridge/BridgeWrapper.cpp 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/pluginBridge/BridgeWrapper.cpp 2015-06-09 20:36:42 UTC (rev 5286) @@ -468,8 +468,23 @@ } MPT_FALLTHROUGH; case audioMasterIOChanged: - // Set up new processing file - processMem.Open(reinterpret_cast<wchar_t *>(ptr)); + { + // If the song is playing, the rendering thread might be active at the moment, + // so we should keep the current processing memory alive until it is done for sure. + const CVstPlugin *plug = FromVstPtr<CVstPlugin>(sharedMem->effect.resvd1); + const bool isPlaying = plug != nullptr && plug->IsSongPlaying(); + if(isPlaying) + { + oldProcessMem.CopyFrom(processMem); + } + // Set up new processing file + processMem.Open(reinterpret_cast<wchar_t *>(ptr)); + if(isPlaying) + { + msg->result = 1; + return; + } + } break; case audioMasterOpenFileSelector: @@ -644,9 +659,20 @@ break; case effVendorSpecific: - if(index == kVendorOpenMPT && value == kGetWrapperPointer) + if(index == kVendorOpenMPT) { - return ToVstPtr<BridgeWrapper>(that); + switch(value) + { + case kGetWrapperPointer: + return ToVstPtr<BridgeWrapper>(that); + + case kCloseOldProcessingMemory: + { + VstIntPtr result = that->oldProcessMem.Good(); + that->oldProcessMem.Close(); + return result; + } + } } break; Modified: trunk/OpenMPT/pluginBridge/BridgeWrapper.h =================================================================== --- trunk/OpenMPT/pluginBridge/BridgeWrapper.h 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/pluginBridge/BridgeWrapper.h 2015-06-09 20:36:42 UTC (rev 5286) @@ -63,6 +63,7 @@ { protected: Event sigAutomation; + MappedMemory oldProcessMem; bool isSettingProgram; ERect editRect; Modified: trunk/OpenMPT/pluginBridge/PluginBridge.vcxproj =================================================================== --- trunk/OpenMPT/pluginBridge/PluginBridge.vcxproj 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/pluginBridge/PluginBridge.vcxproj 2015-06-09 20:36:42 UTC (rev 5286) @@ -206,6 +206,7 @@ <ClInclude Include="AEffectWrapper.h" /> <ClInclude Include="Bridge.h" /> <ClInclude Include="BridgeCommon.h" /> + <ClInclude Include="BridgeOpCodes.h" /> </ItemGroup> <ItemGroup> <ResourceCompile Include="PluginBridge.rc" /> Modified: trunk/OpenMPT/pluginBridge/PluginBridge.vcxproj.filters =================================================================== --- trunk/OpenMPT/pluginBridge/PluginBridge.vcxproj.filters 2015-06-09 19:13:05 UTC (rev 5285) +++ trunk/OpenMPT/pluginBridge/PluginBridge.vcxproj.filters 2015-06-09 20:36:42 UTC (rev 5286) @@ -10,6 +10,9 @@ <ClInclude Include="Bridge.h"> <Filter>Header Files</Filter> </ClInclude> + <ClInclude Include="BridgeOpCodes.h"> + <Filter>Header Files</Filter> + </ClInclude> </ItemGroup> <ItemGroup> <Filter Include="Header Files"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-11 19:18:14
|
Revision: 5290 http://sourceforge.net/p/modplug/code/5290 Author: saga-games Date: 2015-06-11 19:18:07 +0000 (Thu, 11 Jun 2015) Log Message: ----------- [Fix] Tuning Dialog: Editing a note name no longer requires to remove the octave number first. Modified Paths: -------------- trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/soundlib/tuning.cpp trunk/OpenMPT/soundlib/tuning.h trunk/OpenMPT/soundlib/tuningbase.cpp trunk/OpenMPT/soundlib/tuningbase.h Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.cpp 2015-06-10 20:57:31 UTC (rev 5289) +++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2015-06-11 19:18:07 UTC (rev 5290) @@ -125,12 +125,12 @@ } void CTuningDialog::DeleteTreeItem(CTuningCollection* pTC) -//--------------------------------------------- +//-------------------------------------------------------- { if(!pTC) return; - m_pActiveTuning = NULL; + m_pActiveTuning = nullptr; const HTREEITEM temp = m_TreeItemTuningItemMap.GetMapping_21(TUNINGTREEITEM(pTC)); if(temp) { @@ -139,12 +139,12 @@ CTuningCollection* pTCprev = prevTTI.GetTC(); CTuningCollection* pTCnext = nextTTI.GetTC(); - if(pTCnext == NULL) + if(pTCnext == nullptr) pTCnext = GetpTuningCollection(nextTTI.GetT()); - if(pTCprev == NULL) + if(pTCprev == nullptr) pTCprev = GetpTuningCollection(prevTTI.GetT()); - if(pTCnext != NULL && pTCnext != m_pActiveTuningCollection) + if(pTCnext != nullptr && pTCnext != m_pActiveTuningCollection) m_pActiveTuningCollection = pTCnext; else { @@ -601,7 +601,7 @@ m_RatioEditApply = false; m_EditRatio.SetWindowText(mpt::ToString(m_pActiveTuning->GetRatio(note)).c_str()); m_NoteEditApply = false; - m_EditNotename.SetWindowText(m_pActiveTuning->GetNoteName(note).c_str()); + m_EditNotename.SetWindowText(m_pActiveTuning->GetNoteName(note, false).c_str()); m_EditRatio.Invalidate(); m_EditNotename.Invalidate(); Modified: trunk/OpenMPT/soundlib/tuning.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuning.cpp 2015-06-10 20:57:31 UTC (rev 5289) +++ trunk/OpenMPT/soundlib/tuning.cpp 2015-06-11 19:18:07 UTC (rev 5290) @@ -61,25 +61,25 @@ static RATIOTYPE Pow(const RATIOTYPE r, const STEPINDEXTYPE s) -//------------------------------------------------------------- +//------------------------------------------------------------ { if(s == 0) return 1; RATIOTYPE result = r; - STEPINDEXTYPE absS = (s > 0) ? s : -s; - for(STEPINDEXTYPE i = 1; i<absS; i++) result *= r; + STEPINDEXTYPE absS = std::abs(s); + for(STEPINDEXTYPE i = 1; i < absS; i++) result *= r; return (s > 0) ? result : 1/result; } CTuningRTI::CTuningRTI(const CTuning* const pTun) -//------------------------------------------ +//----------------------------------------------- { SetDummyValues(); if(pTun) TuningCopy(*this, *pTun); } void CTuningRTI::SetDummyValues() -//--------------------------------- +//------------------------------- { if(MayEdit(EM_RATIOS)) { @@ -94,11 +94,11 @@ bool CTuningRTI::CreateRatioTableGG(const std::vector<RATIOTYPE>& v, const RATIOTYPE r, const VRPAIR& vr, const NOTEINDEXTYPE ratiostartpos) -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------------------------------------------------ { if(v.size() == 0 || r <= 0) return true; - m_StepMin = vr.first; + m_StepMin = vr.first; ProSetGroupSize(static_cast<UNOTEINDEXTYPE>(v.size())); ProSetGroupRatio(r); @@ -119,7 +119,7 @@ bool CTuningRTI::ProCreateGroupGeometric(const std::vector<RATIOTYPE>& v, const RATIOTYPE& r, const VRPAIR& vr, const NOTEINDEXTYPE ratiostartpos) -//--------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------------------------------------------------------ { //Note: Setting finestep is handled by base class when CreateGroupGeometric is called. if(CreateRatioTableGG(v, r, vr, ratiostartpos)) return true; @@ -128,7 +128,7 @@ bool CTuningRTI::ProCreateGeometric(const UNOTEINDEXTYPE& s, const RATIOTYPE& r, const VRPAIR& vr) -//--------------------------------------------------------------- +//------------------------------------------------------------------------------------------------ { if(vr.second - vr.first + 1 > NOTEINDEXTYPE_MAX) return true; //Note: Setting finestep is handled by base class when CreateGeometric is called. @@ -146,12 +146,12 @@ return false; } -CTuningRTI::NOTESTR CTuningRTI::ProGetNoteName(const NOTEINDEXTYPE& x) const -//----------------------------------------------------- +CTuningRTI::NOTESTR CTuningRTI::ProGetNoteName(const NOTEINDEXTYPE& x, bool addOctave) const +//------------------------------------------------------------------------------------------ { if(GetGroupSize() < 1) { - return CTuning::ProGetNoteName(x); + return CTuning::ProGetNoteName(x, addOctave); } else { @@ -162,7 +162,13 @@ if(nmi != m_NoteNameMap.end()) { rValue = nmi->second; - (x >= 0) ? rValue += mpt::ToString(middlePeriodNumber + x/m_GroupSize) : rValue += mpt::ToString(middlePeriodNumber + (x+1)/m_GroupSize - 1); + if(addOctave) + { + if(x >= 0) + rValue += mpt::ToString(middlePeriodNumber + x / m_GroupSize); + else + rValue += mpt::ToString(middlePeriodNumber + (x + 1) / m_GroupSize - 1); + } } else { @@ -173,7 +179,13 @@ rValue += ":"; - (x >= 0) ? rValue += mpt::ToString(middlePeriodNumber + x/m_GroupSize) : rValue += mpt::ToString(middlePeriodNumber + (x+1)/m_GroupSize - 1); + if(addOctave) + { + if(x >= 0) + rValue += mpt::ToString(middlePeriodNumber + x/m_GroupSize); + else + rValue += mpt::ToString(middlePeriodNumber + (x+1)/m_GroupSize - 1); + } } return rValue; } @@ -185,7 +197,7 @@ //Without finetune CTuning::RATIOTYPE CTuningRTI::GetRatio(const NOTEINDEXTYPE& stepsFromCentre) const -//------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------- { if(stepsFromCentre < m_StepMin) return s_DefaultFallbackRatio; if(stepsFromCentre >= m_StepMin + static_cast<NOTEINDEXTYPE>(m_RatioTable.size())) return s_DefaultFallbackRatio; @@ -195,7 +207,7 @@ //With finetune CTuning::RATIOTYPE CTuningRTI::GetRatio(const NOTEINDEXTYPE& baseNote, const STEPINDEXTYPE& baseStepDiff) const -//---------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------------------- { const STEPINDEXTYPE fsCount = static_cast<STEPINDEXTYPE>(GetFineStepCount()); if(fsCount == 0 || baseStepDiff == 0) @@ -222,7 +234,7 @@ fineStep = ((fsCount + 1) - (abs(baseStepDiff) % (fsCount+1))) % (fsCount+1); } - if(note < m_StepMin) return s_DefaultFallbackRatio; + if(note < m_StepMin) return s_DefaultFallbackRatio; if(note >= m_StepMin + static_cast<NOTEINDEXTYPE>(m_RatioTable.size())) return s_DefaultFallbackRatio; if(fineStep) return m_RatioTable[note - m_StepMin] * GetRatioFine(note, fineStep); @@ -231,7 +243,7 @@ CTuning::RATIOTYPE CTuningRTI::GetRatioFine(const NOTEINDEXTYPE& note, USTEPINDEXTYPE sd) const -//-------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- { if(GetFineStepCount() <= 0) return 1; @@ -244,7 +256,7 @@ { if(GetType() == TT_GEOMETRIC) { - return m_RatioTableFine[sd-1]; + return m_RatioTableFine[sd-1]; } if(GetType() == TT_GROUPGEOMETRIC) return m_RatioTableFine[GetRefNote(note) * GetFineStepCount() + sd - 1]; @@ -263,7 +275,7 @@ bool CTuningRTI::ProSetRatio(const NOTEINDEXTYPE& s, const RATIOTYPE& r) -//-------------------------------------------------------------- +//---------------------------------------------------------------------- { //Creating ratio table if doesn't exist. if(m_RatioTable.empty()) @@ -293,7 +305,7 @@ void CTuningRTI::ProSetFineStepCount(const USTEPINDEXTYPE& fs) -//----------------------------------------------------- +//------------------------------------------------------------ { if(fs <= 0) { @@ -360,7 +372,7 @@ CTuningRTI::NOTEINDEXTYPE CTuningRTI::GetRefNote(const NOTEINDEXTYPE note) const -//------------------------------------------------------ +//------------------------------------------------------------------------------ { if(!IsOfType(TT_GROUPGEOMETRIC)) return 0; @@ -370,7 +382,7 @@ CTuning* CTuningRTI::Deserialize(std::istream& iStrm) -//-------------------------------------------------- +//--------------------------------------------------- { if(iStrm.fail()) return nullptr; @@ -393,7 +405,7 @@ ssb.ReadItem(pTuning->m_SerHelperRatiotableSize, "RTI4"); // If reader status is ok and m_StepMin is somewhat reasonable, process data. - if ((ssb.GetStatus() & srlztn::SNT_FAILURE) == 0 && pTuning->m_StepMin >= -300 && pTuning->m_StepMin <= 300) + if ((ssb.GetStatus() & srlztn::SNT_FAILURE) == 0 && pTuning->m_StepMin >= -300 && pTuning->m_StepMin <= 300) { EDITMASK temp = pTuning->GetEditMask(); pTuning->m_EditMask = EM_ALLOWALL; //Allowing all while processing data. @@ -407,7 +419,7 @@ delete pTuning; pTuning = nullptr; } else - { + { USTEPINDEXTYPE fsTemp = pTuning->m_FineStepCount; pTuning->m_FineStepCount = 0; pTuning->SetFineStepCount(fsTemp); @@ -441,7 +453,7 @@ template<class T, class SIZETYPE> bool VectorFromBinaryStream(std::istream& inStrm, std::vector<T>& v, const SIZETYPE maxSize = (std::numeric_limits<SIZETYPE>::max)()) -//--------------------------------------------------------- +//----------------------------------------------------------------------------------------------------------------------------------- { if(!inStrm.good()) return true; @@ -464,7 +476,7 @@ CTuning::SERIALIZATION_RETURN_TYPE CTuningRTI::Serialize(std::ostream& outStrm) const -//---------------------------------------------------------------------------------- +//----------------------------------------------------------------------------------- { srlztn::SsbWrite ssb(outStrm); ssb.BeginWrite("CTB244RTI", (GetVersion() << 24) + GetClassVersion()); @@ -506,7 +518,7 @@ { void RatioWriter::operator()(std::ostream& oStrm, const std::vector<float>& v) -//--------------------------------------------------------------------------------- +//---------------------------------------------------------------------------- { const size_t nWriteCount = MIN(v.size(), m_nWriteCount); mpt::IO::WriteAdaptiveInt64LE(oStrm, nWriteCount); @@ -516,7 +528,7 @@ void ReadNoteMap(std::istream& iStrm, CTuning::NOTENAMEMAP& m, const size_t) -//---------------------------------------------------------------------------------- +//-------------------------------------------------------------------------- { uint64 val; mpt::IO::ReadAdaptiveInt64LE(iStrm, val); @@ -533,7 +545,7 @@ void ReadRatioTable(std::istream& iStrm, std::vector<CTuningRTI::RATIOTYPE>& v, const size_t) -//------------------------------------------------------------------------------------------ +//------------------------------------------------------------------------------------------- { uint64 val; mpt::IO::ReadAdaptiveInt64LE(iStrm, val); @@ -548,7 +560,7 @@ void ReadStr(std::istream& iStrm, std::string& str, const size_t) -//------------------------------------------------------------------- +//--------------------------------------------------------------- { uint64 val; mpt::IO::ReadAdaptiveInt64LE(iStrm, val); @@ -560,7 +572,7 @@ void WriteNoteMap(std::ostream& oStrm, const CTuning::NOTENAMEMAP& m) -//--------------------------------------------------------------------------- +//------------------------------------------------------------------- { mpt::IO::WriteAdaptiveInt64LE(oStrm, m.size()); CTuning::NNM_CITER iter = m.begin(); @@ -574,7 +586,7 @@ void WriteStr(std::ostream& oStrm, const std::string& str) -//----------------------------------------------------------------- +//-------------------------------------------------------- { mpt::IO::WriteAdaptiveInt64LE(oStrm, str.size()); oStrm.write(str.c_str(), str.size()); @@ -583,4 +595,4 @@ } // namespace CTuningS11n. -OPENMPT_NAMESPACE_END +OPENMPT_NAMESPACE_END \ No newline at end of file Modified: trunk/OpenMPT/soundlib/tuning.h =================================================================== --- trunk/OpenMPT/soundlib/tuning.h 2015-06-10 20:57:31 UTC (rev 5289) +++ trunk/OpenMPT/soundlib/tuning.h 2015-06-11 19:18:07 UTC (rev 5290) @@ -53,10 +53,10 @@ virtual STEPINDEXTYPE GetStepDistance(const NOTEINDEXTYPE& from, const NOTEINDEXTYPE& to) const {return (to - from)*(static_cast<NOTEINDEXTYPE>(GetFineStepCount())+1);} - + virtual STEPINDEXTYPE GetStepDistance(const NOTEINDEXTYPE& noteFrom, const STEPINDEXTYPE& stepDistFrom, const NOTEINDEXTYPE& noteTo, const STEPINDEXTYPE& stepDistTo) const {return GetStepDistance(noteFrom, noteTo) + stepDistTo - stepDistFrom;} - + static CTuning* Deserialize(std::istream& inStrm); static uint32 GetVersion() {return s_SerializationVersion;} @@ -65,8 +65,8 @@ static CTuningRTI* DeserializeOLD(std::istream&) {return 0;} SERIALIZATION_RETURN_TYPE Serialize(std::ostream& out) const; - + public: //PUBLIC CONSTRUCTORS/DESTRUCTORS: CTuningRTI(const std::vector<RATIOTYPE>& ratios, @@ -81,11 +81,11 @@ //Copy tuning. CTuningRTI(const CTuning* const pTun); - + CTuningRTI() {SetDummyValues();} CTuningRTI(const std::string& name) : CTuning(name) {SetDummyValues();} - + CTuningRTI(const NOTEINDEXTYPE& stepMin, const std::string& name) : CTuning(name) { SetDummyValues(); @@ -101,7 +101,7 @@ bool ProCreateGeometric(const UNOTEINDEXTYPE&, const RATIOTYPE&, const VRPAIR&); void ProSetFineStepCount(const USTEPINDEXTYPE&); - virtual NOTESTR ProGetNoteName(const NOTEINDEXTYPE& x) const; + virtual NOTESTR ProGetNoteName(const NOTEINDEXTYPE& xi, bool addOctave) const; //Not implemented. VRPAIR ProSetValidityRange(const VRPAIR&); @@ -113,8 +113,8 @@ virtual uint32 GetClassVersion() const {return GetVersion();} virtual bool ProProcessUnserializationdata(); - + //END PROTECTED VIRTUALS protected: @@ -125,7 +125,7 @@ //Note: Stepdiff should be in range [1, finestepcount] virtual RATIOTYPE GetRatioFine(const NOTEINDEXTYPE& note, USTEPINDEXTYPE stepDiff) const; - //GroupPeriodic-specific. + //GroupPeriodic-specific. //Get the corresponding note in [0, period-1]. //For example GetRefNote(-1) is to return note :'groupsize-1'. NOTEINDEXTYPE GetRefNote(NOTEINDEXTYPE note) const; @@ -137,7 +137,7 @@ //Sets dummy values for *this. void SetDummyValues(); - + bool IsNoteInTable(const NOTEINDEXTYPE& s) const { if(s < m_StepMin || s >= m_StepMin + static_cast<NOTEINDEXTYPE>(m_RatioTable.size())) @@ -152,26 +152,26 @@ //Noteratios std::vector<RATIOTYPE> m_RatioTable; - + //'Fineratios' std::vector<RATIOTYPE> m_RatioTableFine; - + //The lowest index of note in the table NOTEINDEXTYPE m_StepMin; // this should REALLY be called 'm_NoteMin' renaming was missed in r192 - + //For groupgeometric tunings, tells the 'group size' and 'group ratio' //m_GroupSize should always be >= 0. NOTEINDEXTYPE m_GroupSize; RATIOTYPE m_GroupRatio; - + //<----Actual data members mutable UNOTEINDEXTYPE m_SerHelperRatiotableSize; static const std::string s_DerivedclassID; - + }; //End: CTuningRTI declaration. -OPENMPT_NAMESPACE_END +OPENMPT_NAMESPACE_END \ No newline at end of file Modified: trunk/OpenMPT/soundlib/tuningbase.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuningbase.cpp 2015-06-10 20:57:31 UTC (rev 5289) +++ trunk/OpenMPT/soundlib/tuningbase.cpp 2015-06-11 19:18:07 UTC (rev 5290) @@ -89,7 +89,7 @@ void CTuningBase::TuningCopy(CTuningBase& to, const CTuningBase& from, const bool allowExactnamecopy) -//------------------------------------------------------------------------------------ +//--------------------------------------------------------------------------------------------------- { if(!to.MayEdit(EM_ALLOWALL)) return; @@ -121,7 +121,7 @@ bool CTuningBase::SetRatio(const NOTEINDEXTYPE& s, const RATIOTYPE& r) -//----------------------------------------------------------------- +//-------------------------------------------------------------------- { if(MayEdit(EM_RATIOS)) { @@ -138,7 +138,7 @@ CTuningBase::USTEPINDEXTYPE CTuningBase::SetFineStepCount(const USTEPINDEXTYPE& fs) -//------------------------------------------------------- +//--------------------------------------------------------------------------------- { VRPAIR vrp = GetValidityRange(); @@ -157,7 +157,7 @@ CTuningBase::TUNINGTYPE CTuningBase::GetTuningType(const char* str) -//-------------------------------------------------------------------------- +//----------------------------------------------------------------- { if(!strcmp(str, s_TuningTypeStrGroupGeometric)) return TT_GROUPGEOMETRIC; @@ -169,7 +169,7 @@ std::string CTuningBase::GetTuningTypeStr(const TUNINGTYPE& tt) -//---------------------------------------------------------------- +//------------------------------------------------------------- { if(tt == TT_GENERAL) return s_TuningTypeStrGeneral; @@ -183,16 +183,16 @@ -CTuningBase::NOTESTR CTuningBase::GetNoteName(const NOTEINDEXTYPE& x) const -//----------------------------------------------------------------------- +CTuningBase::NOTESTR CTuningBase::GetNoteName(const NOTEINDEXTYPE& x, bool addOctave) const +//----------------------------------------------------------------------------------------- { if(!IsValidNote(x)) return ""; - else return ProGetNoteName(x); + else return ProGetNoteName(x, addOctave); } -CTuningBase::NOTESTR CTuningBase::ProGetNoteName(const NOTEINDEXTYPE& x) const -//------------------------------------------------------------------------------------- +CTuningBase::NOTESTR CTuningBase::ProGetNoteName(const NOTEINDEXTYPE& x, bool /*addOctave*/) const +//------------------------------------------------------------------------------------------------ { NNM_CITER i = m_NoteNameMap.find(x); if(i != m_NoteNameMap.end()) @@ -204,7 +204,7 @@ bool CTuningBase::IsOfType(const TUNINGTYPE& type) const -//---------------------------------------------------- +//------------------------------------------------------ { if(type == TT_GENERAL) return true; @@ -224,7 +224,7 @@ bool CTuningBase::SetNoteName(const NOTEINDEXTYPE& n, const std::string& str) -//----------------------------------------------------------------------- +//--------------------------------------------------------------------------- { if(MayEdit(EM_NOTENAME)) { @@ -238,7 +238,7 @@ bool CTuningBase::ClearNoteName(const NOTEINDEXTYPE& n, const bool eraseAll) -//------------------------------------------------------- +//-------------------------------------------------------------------------- { if(MayEdit(EM_NOTENAME)) { @@ -263,7 +263,7 @@ bool CTuningBase::Multiply(const RATIOTYPE& r) -//--------------------------------------------------- +//-------------------------------------------- { if(r <= 0 || !MayEdit(EM_RATIOS)) return true; @@ -281,7 +281,7 @@ bool CTuningBase::CreateGroupGeometric(const NOTEINDEXTYPE& s, const RATIOTYPE& r, const NOTEINDEXTYPE& startindex) -//------------------------------------------------------------- +//----------------------------------------------------------------------------------------------------------------- { if(s < 1 || r <= 0 || startindex < GetValidityRange().first) return true; @@ -295,7 +295,7 @@ bool CTuningBase::CreateGroupGeometric(const std::vector<RATIOTYPE>& v, const RATIOTYPE& r, const VRPAIR vr, const NOTEINDEXTYPE ratiostartpos) -//------------------------------------------------------------------------------------------ +//--------------------------------------------------------------------------------------------------------------------------------------------- { if(MayEdit(EM_RATIOS) && (MayEdit(EM_TYPE) || GetType() == TT_GROUPGEOMETRIC)) @@ -320,7 +320,7 @@ bool CTuningBase::CreateGeometric(const UNOTEINDEXTYPE& s, const RATIOTYPE& r, const VRPAIR vr) -//------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- { if(MayEdit(EM_RATIOS) && (MayEdit(EM_TYPE) || GetType() == TT_GEOMETRIC)) @@ -344,7 +344,7 @@ bool CTuningBase::ChangeGroupsize(const NOTEINDEXTYPE& s) -//--------------------------------------------------- +//------------------------------------------------------- { if(!MayEdit(EM_RATIOS) || s < 1) return true; @@ -361,7 +361,7 @@ bool CTuningBase::ChangeGroupRatio(const RATIOTYPE& r) -//--------------------------------------------------- +//---------------------------------------------------- { if(!MayEdit(EM_RATIOS) || r <= 0) return true; @@ -378,7 +378,7 @@ const char* CTuningBase::GetTuningTypeDescription(const TUNINGTYPE& type) -//--------------------------------------------------------------------------------------- +//----------------------------------------------------------------------- { if(type == TT_GENERAL) return s_TuningDescriptionGeneral; @@ -391,7 +391,7 @@ CTuningBase::VRPAIR CTuningBase::SetValidityRange(const VRPAIR& vrp) -//---------------------------------------------------------------------------------------- +//------------------------------------------------------------------ { if(vrp.second < vrp.first) return GetValidityRange(); if(IsStepCountRangeSufficient(GetFineStepCount(), vrp) @@ -406,7 +406,7 @@ bool CTuningBase::SetType(const TUNINGTYPE& tt) -//---------------------------------------------- +//--------------------------------------------- { //Note: This doesn't check whether the tuning ratios //are consistent with given type. @@ -429,7 +429,7 @@ bool CTuningBase::DeserializeOLD(std::istream& inStrm) -//------------------------------------------------ +//---------------------------------------------------- { char begin[8]; int16 version; @@ -476,4 +476,4 @@ } -OPENMPT_NAMESPACE_END +OPENMPT_NAMESPACE_END \ No newline at end of file Modified: trunk/OpenMPT/soundlib/tuningbase.h =================================================================== --- trunk/OpenMPT/soundlib/tuningbase.h 2015-06-10 20:57:31 UTC (rev 5289) +++ trunk/OpenMPT/soundlib/tuningbase.h 2015-06-11 19:18:07 UTC (rev 5290) @@ -35,7 +35,7 @@ //RATIOTYPE: Some 'real figure' type able to present ratios. //STEPINDEXTYPE: Counter of steps between notes. If there is no 'finetune'(finestepcount == 0), //then 'step difference' between notes is the - //same as differences in NOTEINDEXTYPE. In a way similar to ticks and rows in pattern - + //same as differences in NOTEINDEXTYPE. In a way similar to ticks and rows in pattern - //ticks <-> STEPINDEX, rows <-> NOTEINDEX public: @@ -125,7 +125,7 @@ //Create GroupGeometric tuning of *this using virtual ProCreateGroupGeometric. bool CreateGroupGeometric(const std::vector<RATIOTYPE>&, const RATIOTYPE&, const VRPAIR vr, const NOTEINDEXTYPE ratiostartpos); - //Create GroupGeometric of *this using ratios from 'itself' and ratios starting from + //Create GroupGeometric of *this using ratios from 'itself' and ratios starting from //position given as third argument. bool CreateGroupGeometric(const NOTEINDEXTYPE&, const RATIOTYPE&, const NOTEINDEXTYPE&); @@ -135,10 +135,10 @@ virtual SERIALIZATION_RETURN_TYPE Serialize(std::ostream& /*out*/) const {return false;} - NOTESTR GetNoteName(const NOTEINDEXTYPE& x) const; + NOTESTR GetNoteName(const NOTEINDEXTYPE& x, bool addOctave = true) const; void SetName(const std::string& s); - + std::string GetName() const {return m_TuningName;} bool SetNoteName(const NOTEINDEXTYPE&, const std::string&); @@ -179,7 +179,7 @@ //Checking that step distances can be presented with //value range of STEPINDEXTYPE with given finestepcount and validityrange. bool IsStepCountRangeSufficient(USTEPINDEXTYPE fs, VRPAIR vrp); - + virtual const char* GetTuningTypeDescription() const; static const char* GetTuningTypeDescription(const TUNINGTYPE&); @@ -202,12 +202,12 @@ //tuningtype is automatically changed to general. virtual bool ProSetRatio(const NOTEINDEXTYPE&, const RATIOTYPE&) {return true;} - virtual NOTESTR ProGetNoteName(const NOTEINDEXTYPE&) const; + virtual NOTESTR ProGetNoteName(const NOTEINDEXTYPE&, bool) const; //The two methods below return false if action was done, true otherwise. virtual bool ProCreateGroupGeometric(const std::vector<RATIOTYPE>&, const RATIOTYPE&, const VRPAIR&, const NOTEINDEXTYPE /*ratiostartpos*/) {return true;} virtual bool ProCreateGeometric(const UNOTEINDEXTYPE&, const RATIOTYPE&, const VRPAIR&) {return true;} - + virtual VRPAIR ProSetValidityRange(const VRPAIR&) {return GetValidityRange();} virtual void ProSetFineStepCount(const USTEPINDEXTYPE&) {} @@ -325,4 +325,4 @@ } -OPENMPT_NAMESPACE_END +OPENMPT_NAMESPACE_END \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-12 15:15:12
|
Revision: 5293 http://sourceforge.net/p/modplug/code/5293 Author: saga-games Date: 2015-06-12 15:15:05 +0000 (Fri, 12 Jun 2015) Log Message: ----------- [New] Export: It is now possible to export to a sample slot rather than a file (http://bugs.openmpt.org/view.php?id=561). [Mod] OpenMPT: Version is now 1.25.00.13 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/mod2wave.h trunk/OpenMPT/mptrack/mptrack.rc Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2015-06-11 20:16:08 UTC (rev 5292) +++ trunk/OpenMPT/common/versionNumber.h 2015-06-12 15:15:05 UTC (rev 5293) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 25 #define VER_MINOR 00 -#define VER_MINORMINOR 12 +#define VER_MINORMINOR 13 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2015-06-11 20:16:08 UTC (rev 5292) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2015-06-12 15:15:05 UTC (rev 5293) @@ -40,17 +40,6 @@ } -static mpt::ustring GetDefaultArtist() -//------------------------------------ -{ - if(std::getenv("USERNAME")) - { - return mpt::ToUnicode(mpt::CharsetLocale, std::getenv("USERNAME")); - } - return mpt::ustring(); -} - - static mpt::ustring GetDefaultYear() //---------------------------------- { @@ -60,7 +49,7 @@ StoredTags::StoredTags(SettingsContainer &conf) //--------------------------------------------- - : artist(conf, "Export", "TagArtist", GetDefaultArtist()) + : artist(conf, "Export", "TagArtist", TrackerSettings::Instance().defaultArtist) , album(conf, "Export", "TagAlbum", MPT_USTRING("")) , trackno(conf, "Export", "TagTrackNo", MPT_USTRING("")) , year(conf, "Export", "TagYear", GetDefaultYear()) @@ -81,6 +70,8 @@ ON_COMMAND(IDC_CHECK6, OnCheckInstrMode) ON_COMMAND(IDC_RADIO1, UpdateDialog) ON_COMMAND(IDC_RADIO2, UpdateDialog) + ON_COMMAND(IDC_RADIO3, UpdateDialog) + ON_COMMAND(IDC_RADIO4, UpdateDialog) ON_COMMAND(IDC_PLAYEROPTIONS, OnPlayerOptions) ON_COMMAND(IDC_BUTTON1, OnShowEncoderInfo) ON_CBN_SELCHANGE(IDC_COMBO5, OnFileTypeChanged) @@ -193,6 +184,8 @@ } } + CheckRadioButton(IDC_RADIO3, IDC_RADIO4, m_Settings.outputToSample ? IDC_RADIO4 : IDC_RADIO3); + UpdateDialog(); return TRUE; } @@ -536,7 +529,6 @@ //-------------------------------------- { SaveEncoderSettings(); - //DWORD dwSamplerate = m_CbnSampleRate.GetItemData(m_CbnSampleRate.GetCurSel()); FillFormats(); FillDither(); } @@ -546,7 +538,6 @@ //------------------------------------ { SaveEncoderSettings(); - //UINT nChannels = m_CbnChannels.GetItemData(m_CbnChannels.GetCurSel()); FillFormats(); FillDither(); } @@ -563,7 +554,6 @@ //---------------------------------- { SaveEncoderSettings(); - //DWORD dwFormat = m_CbnSampleFormat.GetItemData(m_CbnSampleFormat.GetCurSel()); FillDither(); FillTags(); } @@ -578,14 +568,23 @@ ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT2), (m_dwSongLimit) ? TRUE : FALSE); // Repeat / selection play - BOOL bSel = IsDlgButtonChecked(IDC_RADIO2) ? TRUE : FALSE; - /*m_SpinMinOrder.EnableWindow(bSel); - m_SpinMaxOrder.EnableWindow(bSel);*/ + BOOL bSel = (IsDlgButtonChecked(IDC_RADIO2) != BST_UNCHECKED) ? TRUE : FALSE; GetDlgItem(IDC_EDIT3)->EnableWindow(bSel); GetDlgItem(IDC_EDIT4)->EnableWindow(bSel); GetDlgItem(IDC_EDIT5)->EnableWindow(!bSel); + m_SpinLoopCount.EnableWindow(!bSel); - m_SpinLoopCount.EnableWindow(!bSel); + bSel = (IsDlgButtonChecked(IDC_RADIO4) != BST_UNCHECKED) ? FALSE : TRUE; + m_CbnFileType.EnableWindow(bSel); + if(!bSel) + { + // Render to sample: Always use WAV + if(m_CbnFileType.GetCurSel() != 0) + { + m_CbnFileType.SetCurSel(0); + OnFileTypeChanged(); + } + } } @@ -670,8 +669,9 @@ } m_Settings.repeatCount = static_cast<uint16>(GetDlgItemInt(IDC_EDIT5, NULL, FALSE)); - m_Settings.Normalize = IsDlgButtonChecked(IDC_CHECK5) != BST_UNCHECKED; - m_Settings.SilencePlugBuffers = IsDlgButtonChecked(IDC_RENDERSILENCE) != BST_UNCHECKED; + m_Settings.normalize = IsDlgButtonChecked(IDC_CHECK5) != BST_UNCHECKED; + m_Settings.silencePlugBuffers = IsDlgButtonChecked(IDC_RENDERSILENCE) != BST_UNCHECKED; + m_Settings.outputToSample = IsDlgButtonChecked(IDC_RADIO4) != BST_UNCHECKED; m_bGivePlugsIdleTime = IsDlgButtonChecked(IDC_GIVEPLUGSIDLETIME) != BST_UNCHECKED; if (m_bGivePlugsIdleTime) { @@ -845,8 +845,9 @@ , storedTags(conf) , repeatCount(0) , minOrder(ORDERINDEX_INVALID), maxOrder(ORDERINDEX_INVALID) - , Normalize(false) - , SilencePlugBuffers(false) + , normalize(false) + , silencePlugBuffers(false) + , outputToSample(false) { for(std::size_t i = 0; i < EncoderFactories.size(); ++i) { @@ -912,7 +913,7 @@ float normalizePeak = 0.0f; const mpt::PathString normalizeFileName = Util::CreateTempFileName(MPT_PATHSTRING("OpenMPT")); mpt::fstream normalizeFile; - if(m_Settings.Normalize) + if(m_Settings.normalize) { normalizeFile.open(normalizeFileName, std::ios::binary | std::ios::in | std::ios::out | std::ios::trunc); } @@ -934,7 +935,7 @@ IAudioStreamEncoder *fileEnc = m_Settings.GetEncoderFactory()->ConstructStreamEncoder(fileStream); // Silence mix buffer of plugins, for plugins that don't clear their reverb buffers and similar stuff when they are reset - if(m_Settings.SilencePlugBuffers) + if(m_Settings.silencePlugBuffers) { SetDlgItemText(IDC_TEXT1, _T("Clearing plugin buffers")); for(PLUGINDEX i = 0; i < MAX_MIXPLUGINS; i++) @@ -971,7 +972,7 @@ mixersettings.gdwMixingFreq = samplerate; mixersettings.gnChannels = channels; m_SndFile.m_SongFlags.reset(SONG_PAUSED | SONG_STEP); - if(m_Settings.Normalize) + if(m_Settings.normalize) { #ifndef NO_AGC mixersettings.DSPMask &= ~SNDDSP_AGC; @@ -1057,7 +1058,7 @@ for (UINT n = 0; ; n++) { UINT lRead = 0; - if(m_Settings.Normalize || m_Settings.FinalSampleFormat == SampleFormatFloat32) + if(m_Settings.normalize || m_Settings.FinalSampleFormat == SampleFormatFloat32) { lRead = ReadInterleaved(m_SndFile, floatbuffer, MIXBUFFERSIZE, SampleFormatFloat32, dither); } else @@ -1087,7 +1088,7 @@ break; ullSamples += lRead; - if(m_Settings.Normalize) + if(m_Settings.normalize) { std::size_t countSamples = lRead * m_SndFile.m_MixerSettings.gnChannels; @@ -1140,7 +1141,7 @@ timeRemaining = static_cast<uint32>(((dwCurrentTime - dwStartTime) * (max - ullSamples) / ullSamples) / 1000); } - if(m_Settings.Normalize) + if(m_Settings.normalize) { _stprintf(s, _T("Rendering file... (%umn%02us, %umn%02us remaining)"), l / 60, l % 60, timeRemaining / 60, timeRemaining % 60u); } else @@ -1178,7 +1179,7 @@ CMainFrame::GetMainFrame()->StopRenderer(&m_SndFile); - if(m_Settings.Normalize) + if(m_Settings.normalize) { ::SendMessage(progress, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2015-06-11 20:16:08 UTC (rev 5292) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2015-06-12 15:15:05 UTC (rev 5293) @@ -1684,7 +1684,7 @@ .DefaultFilename(GetPathNameMpt().GetFileName() + MPT_PATHSTRING(".") + extension) .ExtensionFilter(encFactory->GetTraits().fileDescription + MPT_USTRING(" (*.") + extension.ToUnicode() + MPT_USTRING(")|*.") + extension.ToUnicode() + MPT_USTRING("||")) .WorkingDirectory(TrackerSettings::Instance().PathExport.GetWorkingDir()); - if(!dlg.Show()) return; + if(!wsdlg.m_Settings.outputToSample && !dlg.Show()) return; // will set default dir here because there's no setup option for export dir yet (feel free to add one...) TrackerSettings::Instance().PathExport.SetDefaultDir(dlg.GetWorkingDirectory(), true); @@ -1810,6 +1810,10 @@ thisName += mpt::PathString::FromUnicode(mpt::ToUnicode(mpt::CharsetLocale, fileNameAdd)); } thisName += fileExt; + if(wsdlg.m_Settings.outputToSample) + { + thisName = Util::CreateTempFileName(MPT_PATHSTRING("OpenMPT")); + } // Render song (or current channel, or current sample/instrument) CDoWaveConvert dwcdlg(m_SndFile, thisName, wsdlg.m_Settings, pMainFrm); @@ -1817,7 +1821,48 @@ dwcdlg.m_bGivePlugsIdleTime = wsdlg.m_bGivePlugsIdleTime; dwcdlg.m_dwSongLimit = wsdlg.m_dwSongLimit; - if(dwcdlg.DoModal() != IDOK) break; + bool cancel = dwcdlg.DoModal() != IDOK; + + if(wsdlg.m_Settings.outputToSample) + { + if(!cancel) + { + InputFile f(thisName); + if(f.IsValid()) + { + FileReader file = GetFileReader(f); + SAMPLEINDEX smp = m_SndFile.GetNextFreeSample(); + if(smp == SAMPLEINDEX_INVALID) + { + Reporting::Error(_T("Too many samples!")); + break; + } + if(m_SndFile.ReadSampleFromFile(smp, file, false)) + { + UpdateAllViews(nullptr, SampleHint().Info().Data().Names()); + if(m_SndFile.GetNumInstruments()) + { + InsertInstrument(smp); + UpdateAllViews(nullptr, InstrumentHint().Info().Names()); + } + SetModified(); + } + } + } + + // Always clean up after ourselves + for(int retry = 0; retry < 10; retry++) + { + // stupid virus scanners + if(DeleteFileW(thisName.AsNative().c_str()) != EACCES) + { + break; + } + Sleep(10); + } + } + + if(cancel) break; } // Restore channels' flags Modified: trunk/OpenMPT/mptrack/mod2wave.h =================================================================== --- trunk/OpenMPT/mptrack/mod2wave.h 2015-06-11 20:16:08 UTC (rev 5292) +++ trunk/OpenMPT/mptrack/mod2wave.h 2015-06-12 15:15:05 UTC (rev 5293) @@ -52,8 +52,9 @@ int repeatCount; ORDERINDEX minOrder, maxOrder; - bool Normalize; - bool SilencePlugBuffers; + bool normalize : 1; + bool silencePlugBuffers : 1; + bool outputToSample : 1; std::size_t FindEncoder(const mpt::ustring &name) const; void SelectEncoder(std::size_t index); @@ -129,7 +130,7 @@ public: const CWaveConvertSettings &m_Settings; CSoundFile &m_SndFile; - mpt::PathString m_lpszFileName; + const mpt::PathString &m_lpszFileName; uint64 m_dwFileLimit, m_dwSongLimit; bool m_bAbort, m_bGivePlugsIdleTime; Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2015-06-11 20:16:08 UTC (rev 5292) +++ trunk/OpenMPT/mptrack/mptrack.rc 2015-06-12 15:15:05 UTC (rev 5293) @@ -635,7 +635,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,270,216,50,14 PUSHBUTTON "Cancel",IDCANCEL,330,216,50,14 - GROUPBOX "Format",IDC_STATIC,6,6,186,66 + GROUPBOX "For&mat",IDC_STATIC,6,6,186,66 COMBOBOX IDC_COMBO5,12,18,90,82,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Encoder Information",IDC_BUTTON1,108,18,78,12 COMBOBOX IDC_COMBO1,12,36,54,82,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -660,7 +660,7 @@ EDITTEXT IDC_EDIT1,324,18,50,12,ES_AUTOHSCROLL CONTROL "Limit song &length to: (seconds)",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,37,114,10 EDITTEXT IDC_EDIT2,324,36,50,12,ES_AUTOHSCROLL - CONTROL "Play &entire song",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,204,54,72,12 + CONTROL "Play &entire song",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,204,54,72,12 CONTROL "From &position",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,204,73,72,12 EDITTEXT IDC_EDIT5,276,54,36,12,ES_AUTOHSCROLL | ES_NUMBER CONTROL "",IDC_SPIN5,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,300,60,11,11 @@ -685,6 +685,9 @@ COMBOBOX IDC_COMBO3,240,192,78,64,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP RTEXT "Year:",IDC_STATIC,324,194,18,8 EDITTEXT IDC_EDIT9,348,192,30,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Export To:",IDC_STATIC,6,219,48,8 + CONTROL "&File",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON | WS_GROUP,54,219,48,8 + CONTROL "S&le Slot",IDC_RADIO4,"Button",BS_AUTORADIOBUTTON,96,219,90,8 END IDD_PROGRESS DIALOG 0, 0, 186, 55 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-06-13 11:59:31
|
Revision: 5297 http://sourceforge.net/p/modplug/code/5297 Author: manxorist Date: 2015-06-13 11:59:24 +0000 (Sat, 13 Jun 2015) Log Message: ----------- [Ref] Add MPT_DO and MPT_WHILE_0 macros that work around the stupid MSVC W4 "conditional expression is constant" warning in every block macro. [Ref] Use MPT_CONSTANT_IF in mpt::saturate_cast to silence MSVC W4 warnings. Modified Paths: -------------- trunk/OpenMPT/common/BuildSettings.h trunk/OpenMPT/common/ComponentManager.h trunk/OpenMPT/common/Endianness.h trunk/OpenMPT/common/Logging.cpp trunk/OpenMPT/common/Logging.h trunk/OpenMPT/common/Profiler.h trunk/OpenMPT/common/misc_util.h trunk/OpenMPT/common/serialization_utils.cpp trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/soundlib/Load_mt2.cpp trunk/OpenMPT/soundlib/SampleFormatConverters.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/test/TestToolsLib.h trunk/OpenMPT/test/TestToolsTracker.h trunk/OpenMPT/test/test.cpp Modified: trunk/OpenMPT/common/BuildSettings.h =================================================================== --- trunk/OpenMPT/common/BuildSettings.h 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/common/BuildSettings.h 2015-06-13 11:59:24 UTC (rev 5297) @@ -500,7 +500,7 @@ #if MPT_COMPILER_MSVC -// happens for do { } while(0) +// happens for if expression that only depend on template parameters #pragma warning(disable:4127) // conditional expression is constant // happens for immutable classes (i.e. classes containing const members) @@ -514,5 +514,5 @@ #pragma warning(disable:4250) // 'mpt::fstream' : inherits 'std::basic_istream<_Elem,_Traits>::std::basic_istream<_Elem,_Traits>::_Add_vtordisp1' via dominance #endif -#endif +#endif // MPT_COMPILER_MSVC Modified: trunk/OpenMPT/common/ComponentManager.h =================================================================== --- trunk/OpenMPT/common/ComponentManager.h 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/common/ComponentManager.h 2015-06-13 11:59:24 UTC (rev 5297) @@ -155,9 +155,9 @@ }; -#define MPT_COMPONENT_BIND(libName, func) do { if(!Bind( func , libName , #func )) { SetBindFailed(); } } while(0) +#define MPT_COMPONENT_BIND(libName, func) MPT_DO { if(!Bind( func , libName , #func )) { SetBindFailed(); } } MPT_WHILE_0 #define MPT_COMPONENT_BIND_OPTIONAL(libName, func) Bind( func , libName , #func ) -#define MPT_COMPONENT_BIND_SYMBOL(libName, symbol, func) do { if(!Bind( func , libName , symbol )) { SetBindFailed(); } } while(0) +#define MPT_COMPONENT_BIND_SYMBOL(libName, symbol, func) MPT_DO { if(!Bind( func , libName , symbol )) { SetBindFailed(); } } MPT_WHILE_0 #define MPT_COMPONENT_BIND_SYMBOL_OPTIONAL(libName, symbol, func) Bind( func , libName , symbol ) Modified: trunk/OpenMPT/common/Endianness.h =================================================================== --- trunk/OpenMPT/common/Endianness.h 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/common/Endianness.h 2015-06-13 11:59:24 UTC (rev 5297) @@ -140,8 +140,8 @@ // argument. // In-place modifying version: -#define SwapBytesBE(value) do { (value) = SwapBytesBE_((value)); } while(0) -#define SwapBytesLE(value) do { (value) = SwapBytesLE_((value)); } while(0) +#define SwapBytesBE(value) MPT_DO { (value) = SwapBytesBE_((value)); } MPT_WHILE_0 +#define SwapBytesLE(value) MPT_DO { (value) = SwapBytesLE_((value)); } MPT_WHILE_0 // Alternative, function-style syntax: #define SwapBytesReturnBE(value) SwapBytesBE_((value)) Modified: trunk/OpenMPT/common/Logging.cpp =================================================================== --- trunk/OpenMPT/common/Logging.cpp 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/common/Logging.cpp 2015-06-13 11:59:24 UTC (rev 5297) @@ -33,7 +33,7 @@ #if MPT_COMPILER_MSVC || (MPT_COMPILER_GCC && MPT_GCC_AT_LEAST(4,3,0) && MPT_GCC_BEFORE(4,4,0)) #ifndef va_copy -#define va_copy(dst, src) do { (dst) = (src); } while (0) +#define va_copy(dst, src) MPT_DO { (dst) = (src); } MPT_WHILE_0 #endif #endif Modified: trunk/OpenMPT/common/Logging.h =================================================================== --- trunk/OpenMPT/common/Logging.h 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/common/Logging.h 2015-06-13 11:59:24 UTC (rev 5297) @@ -138,13 +138,13 @@ void Seal(); bool Dump(const mpt::PathString &filename); -#define MPT_TRACE() do { if(mpt::log::Trace::g_Enabled) { mpt::log::Trace::Trace(MPT_LOG_CURRENTCONTEXT()); } } while(0) +#define MPT_TRACE() MPT_DO { if(mpt::log::Trace::g_Enabled) { mpt::log::Trace::Trace(MPT_LOG_CURRENTCONTEXT()); } } MPT_WHILE_0 } // namespace Trace #else // !MODPLUG_TRACKER -#define MPT_TRACE() do { } while(0) +#define MPT_TRACE() MPT_DO { } MPT_WHILE_0 #endif // MODPLUG_TRACKER Modified: trunk/OpenMPT/common/Profiler.h =================================================================== --- trunk/OpenMPT/common/Profiler.h 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/common/Profiler.h 2015-06-13 11:59:24 UTC (rev 5297) @@ -115,8 +115,8 @@ static std::string DumpProfiles() { return std::string(); } static std::vector<double> DumpCategories() { return std::vector<double>(); } }; -#define OPENMPT_PROFILE_SCOPE(cat, name) do { } while(0) -#define OPENMPT_PROFILE_FUNCTION(cat) do { } while(0) +#define OPENMPT_PROFILE_SCOPE(cat, name) MPT_DO { } MPT_WHILE_0 +#define OPENMPT_PROFILE_FUNCTION(cat) MPT_DO { } MPT_WHILE_0 #endif // USE_PROFILER Modified: trunk/OpenMPT/common/misc_util.h =================================================================== --- trunk/OpenMPT/common/misc_util.h 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/common/misc_util.h 2015-06-13 11:59:24 UTC (rev 5297) @@ -122,34 +122,34 @@ // This code tries not only to obviously avoid overflows but also to avoid signed/unsigned comparison warnings and type truncation warnings (which in fact would be safe here) by explicit casting. STATIC_ASSERT(std::numeric_limits<Tdst>::is_integer); STATIC_ASSERT(std::numeric_limits<Tsrc>::is_integer); - if(std::numeric_limits<Tdst>::is_signed && std::numeric_limits<Tsrc>::is_signed) + MPT_CONSTANT_IF(std::numeric_limits<Tdst>::is_signed && std::numeric_limits<Tsrc>::is_signed) { - if(sizeof(Tdst) >= sizeof(Tsrc)) + MPT_CONSTANT_IF(sizeof(Tdst) >= sizeof(Tsrc)) { return static_cast<Tdst>(src); } return static_cast<Tdst>(std::max<Tsrc>(static_cast<Tsrc>(std::numeric_limits<Tdst>::min()), std::min<Tsrc>(src, static_cast<Tsrc>(std::numeric_limits<Tdst>::max())))); - } else if(!std::numeric_limits<Tdst>::is_signed && !std::numeric_limits<Tsrc>::is_signed) + } else MPT_CONSTANT_IF(!std::numeric_limits<Tdst>::is_signed && !std::numeric_limits<Tsrc>::is_signed) { - if(sizeof(Tdst) >= sizeof(Tsrc)) + MPT_CONSTANT_IF(sizeof(Tdst) >= sizeof(Tsrc)) { return static_cast<Tdst>(src); } return static_cast<Tdst>(std::min<Tsrc>(src, static_cast<Tsrc>(std::numeric_limits<Tdst>::max()))); - } else if(std::numeric_limits<Tdst>::is_signed && !std::numeric_limits<Tsrc>::is_signed) + } else MPT_CONSTANT_IF(std::numeric_limits<Tdst>::is_signed && !std::numeric_limits<Tsrc>::is_signed) { - if(sizeof(Tdst) > sizeof(Tsrc)) + MPT_CONSTANT_IF(sizeof(Tdst) > sizeof(Tsrc)) { return static_cast<Tdst>(src); } - if(sizeof(Tdst) == sizeof(Tsrc)) + MPT_CONSTANT_IF(sizeof(Tdst) == sizeof(Tsrc)) { return static_cast<Tdst>(std::min<Tsrc>(src, static_cast<Tsrc>(std::numeric_limits<Tdst>::max()))); } return static_cast<Tdst>(std::min<Tsrc>(src, static_cast<Tsrc>(std::numeric_limits<Tdst>::max()))); } else // Tdst unsigned, Tsrc signed { - if(sizeof(Tdst) >= sizeof(Tsrc)) + MPT_CONSTANT_IF(sizeof(Tdst) >= sizeof(Tsrc)) { return static_cast<Tdst>(std::max<Tsrc>(0, src)); } @@ -466,7 +466,7 @@ a = -a; if(b < 0) b = -b; - do + for(;;) { if(a == 0) return b; @@ -474,7 +474,7 @@ if(b == 0) return a; a %= b; - } while(true); + } } // Least Common Multiple. Always returns non-negative number. Modified: trunk/OpenMPT/common/serialization_utils.cpp =================================================================== --- trunk/OpenMPT/common/serialization_utils.cpp 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/common/serialization_utils.cpp 2015-06-13 11:59:24 UTC (rev 5297) @@ -32,7 +32,7 @@ #ifdef SSB_LOGGING #define SSB_LOG(x) Log(x) #else -#define SSB_LOG(x) do{}while(0) +#define SSB_LOG(x) MPT_DO { } MPT_WHILE_0 #endif Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/common/typedefs.h 2015-06-13 11:59:24 UTC (rev 5297) @@ -227,7 +227,7 @@ if(x) \ /**/ #elif MPT_GCC_AT_LEAST(4,4,0) -// GCC 4.4 does not like _Pragma inside functions. +// GCC 4.4 does not like _Pragma diagnostic inside functions. // As GCC 4.4 is one of our major compilers, we do not want a noisy build. // Thus, just disable this warning globally. (not required for now) //#pragma GCC diagnostic ignored "-Wtype-limits" @@ -254,7 +254,24 @@ #endif - + +#if MPT_COMPILER_MSVC +// MSVC warns for the well-known and widespread "do { } while(0)" idiom with warning level 4 ("conditional expression is constant"). +// It does not warn with "while(0,0)". However this again causes warnings with other compilers. +// Solve it with a macro. +#define MPT_DO do +#define MPT_WHILE_0 while(0,0) +#endif + +#ifndef MPT_DO +#define MPT_DO do +#endif +#ifndef MPT_WHILE_0 +#define MPT_WHILE_0 while(0) +#endif + + + // Static code checkers might need to get the knowledge of our assertions transferred to them. #define MPT_CHECKER_ASSUME_ASSERTIONS 1 //#define MPT_CHECKER_ASSUME_ASSERTIONS 0 @@ -268,7 +285,7 @@ #endif #ifndef MPT_CHECKER_ASSUME -#define MPT_CHECKER_ASSUME(x) do { } while(0) +#define MPT_CHECKER_ASSUME(x) MPT_DO { } MPT_WHILE_0 #endif @@ -314,8 +331,8 @@ #define MPT_ASSERT_ALWAYS(expr) ASSERT((expr)) #define MPT_ASSERT_ALWAYS_MSG(expr, msg) ASSERT((expr) && (msg)) #else -#define MPT_ASSERT_ALWAYS(expr) do { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } while(0) -#define MPT_ASSERT_ALWAYS_MSG(expr, msg) do { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr, msg); } MPT_CHECKER_ASSUME(expr); } while(0) +#define MPT_ASSERT_ALWAYS(expr) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 +#define MPT_ASSERT_ALWAYS_MSG(expr, msg) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr, msg); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 #ifndef MPT_ASSERT_HANDLER_NEEDED #define MPT_ASSERT_HANDLER_NEEDED #endif @@ -325,18 +342,18 @@ #define MPT_ASSERT(expr) MPT_CHECKER_ASSUME(expr) #define MPT_ASSERT_MSG(expr, msg) MPT_CHECKER_ASSUME(expr) -#define MPT_ASSERT_ALWAYS(expr) do { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } while(0) -#define MPT_ASSERT_ALWAYS_MSG(expr, msg) do { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr, msg); } MPT_CHECKER_ASSUME(expr); } while(0) +#define MPT_ASSERT_ALWAYS(expr) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 +#define MPT_ASSERT_ALWAYS_MSG(expr, msg) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr, msg); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 #ifndef MPT_ASSERT_HANDLER_NEEDED #define MPT_ASSERT_HANDLER_NEEDED #endif #else // !NO_ASSERTS -#define MPT_ASSERT(expr) do { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } while(0) -#define MPT_ASSERT_MSG(expr, msg) do { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr, msg); } MPT_CHECKER_ASSUME(expr); } while(0) -#define MPT_ASSERT_ALWAYS(expr) do { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } while(0) -#define MPT_ASSERT_ALWAYS_MSG(expr, msg) do { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr, msg); } MPT_CHECKER_ASSUME(expr); } while(0) +#define MPT_ASSERT(expr) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 +#define MPT_ASSERT_MSG(expr, msg) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr, msg); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 +#define MPT_ASSERT_ALWAYS(expr) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 +#define MPT_ASSERT_ALWAYS_MSG(expr, msg) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr, msg); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 #ifndef MPT_ASSERT_HANDLER_NEEDED #define MPT_ASSERT_HANDLER_NEEDED #endif @@ -368,7 +385,7 @@ #elif MPT_COMPILER_CLANG #define MPT_FALLTHROUGH [[clang::fallthrough]] #else -#define MPT_FALLTHROUGH do { } while(0) +#define MPT_FALLTHROUGH MPT_DO { } MPT_WHILE_0 #endif Modified: trunk/OpenMPT/soundlib/Load_mt2.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mt2.cpp 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/soundlib/Load_mt2.cpp 2015-06-13 11:59:24 UTC (rev 5297) @@ -553,7 +553,7 @@ switch(id) { case MAGIC4LE('B','P','M','+'): - if(0) + MPT_CONSTANT_IF(0) { double d = chunk.ReadDoubleLE(); if(fileHeader.samplesPerTick != 0 && d != 0.0) Modified: trunk/OpenMPT/soundlib/SampleFormatConverters.h =================================================================== --- trunk/OpenMPT/soundlib/SampleFormatConverters.h 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/soundlib/SampleFormatConverters.h 2015-06-13 11:59:24 UTC (rev 5297) @@ -639,7 +639,7 @@ forceinline output_t operator() (input_t val) { STATIC_ASSERT(fractionalBits >= 0 && fractionalBits <= sizeof(input_t)*8-1); - if(clipOutput) + MPT_CONSTANT_IF(clipOutput) { float32 out = val * factor; if(out < -1.0f) out = -1.0f; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2015-06-13 11:59:24 UTC (rev 5297) @@ -2343,21 +2343,21 @@ { // Ramping required m_lHighResRampingGlobalVolume += step; - SoundBuffer[0] = Util::muldiv(SoundBuffer[0], m_lHighResRampingGlobalVolume, MAX_GLOBAL_VOLUME << VOLUMERAMPPRECISION); - if(isStereo) SoundBuffer[1] = Util::muldiv(SoundBuffer[1], m_lHighResRampingGlobalVolume, MAX_GLOBAL_VOLUME << VOLUMERAMPPRECISION); - if(hasRear) RearBuffer[0] = Util::muldiv(RearBuffer[0] , m_lHighResRampingGlobalVolume, MAX_GLOBAL_VOLUME << VOLUMERAMPPRECISION); - if(hasRear) RearBuffer[1] = Util::muldiv(RearBuffer[1] , m_lHighResRampingGlobalVolume, MAX_GLOBAL_VOLUME << VOLUMERAMPPRECISION); + SoundBuffer[0] = Util::muldiv(SoundBuffer[0], m_lHighResRampingGlobalVolume, MAX_GLOBAL_VOLUME << VOLUMERAMPPRECISION); + MPT_CONSTANT_IF(isStereo) SoundBuffer[1] = Util::muldiv(SoundBuffer[1], m_lHighResRampingGlobalVolume, MAX_GLOBAL_VOLUME << VOLUMERAMPPRECISION); + MPT_CONSTANT_IF(hasRear) RearBuffer[0] = Util::muldiv(RearBuffer[0] , m_lHighResRampingGlobalVolume, MAX_GLOBAL_VOLUME << VOLUMERAMPPRECISION); + MPT_CONSTANT_IF(hasRear) RearBuffer[1] = Util::muldiv(RearBuffer[1] , m_lHighResRampingGlobalVolume, MAX_GLOBAL_VOLUME << VOLUMERAMPPRECISION); m_nSamplesToGlobalVolRampDest--; } else { - SoundBuffer[0] = Util::muldiv(SoundBuffer[0], m_nGlobalVolume, MAX_GLOBAL_VOLUME); - if(isStereo) SoundBuffer[1] = Util::muldiv(SoundBuffer[1], m_nGlobalVolume, MAX_GLOBAL_VOLUME); - if(hasRear) RearBuffer[0] = Util::muldiv(RearBuffer[0] , m_nGlobalVolume, MAX_GLOBAL_VOLUME); - if(hasRear) RearBuffer[1] = Util::muldiv(RearBuffer[1] , m_nGlobalVolume, MAX_GLOBAL_VOLUME); + SoundBuffer[0] = Util::muldiv(SoundBuffer[0], m_nGlobalVolume, MAX_GLOBAL_VOLUME); + MPT_CONSTANT_IF(isStereo) SoundBuffer[1] = Util::muldiv(SoundBuffer[1], m_nGlobalVolume, MAX_GLOBAL_VOLUME); + MPT_CONSTANT_IF(hasRear) RearBuffer[0] = Util::muldiv(RearBuffer[0] , m_nGlobalVolume, MAX_GLOBAL_VOLUME); + MPT_CONSTANT_IF(hasRear) RearBuffer[1] = Util::muldiv(RearBuffer[1] , m_nGlobalVolume, MAX_GLOBAL_VOLUME); m_lHighResRampingGlobalVolume = m_nGlobalVolume << VOLUMERAMPPRECISION; } SoundBuffer += isStereo ? 2 : 1; - if(hasRear) RearBuffer += 2; + MPT_CONSTANT_IF(hasRear) RearBuffer += 2; } } Modified: trunk/OpenMPT/test/TestToolsLib.h =================================================================== --- trunk/OpenMPT/test/TestToolsLib.h 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/test/TestToolsLib.h 2015-06-13 11:59:24 UTC (rev 5297) @@ -224,7 +224,7 @@ #define DO_TEST(func) \ -do{ \ +MPT_DO { \ Test::Testcase test(Test::FatalityStop, Test::VerbosityVerbose, #func , MPT_TEST_CONTEXT_CURRENT() ); \ try { \ test.ShowStart(); \ @@ -237,7 +237,7 @@ } catch(...) { \ test.ReportException(); \ } \ -}while(0) +} MPT_WHILE_0 } // namespace Test Modified: trunk/OpenMPT/test/TestToolsTracker.h =================================================================== --- trunk/OpenMPT/test/TestToolsTracker.h 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/test/TestToolsTracker.h 2015-06-13 11:59:24 UTC (rev 5297) @@ -33,11 +33,11 @@ // Verify that given parameters are 'equal'. Break directly into the debugger if not. // The exact meaning of equality is based on operator!= . #define VERIFY_EQUAL(x,y) \ - do { \ + MPT_DO { \ if((x) != (y)) { \ MyDebugBreak(); \ } \ - } while(0) \ + } MPT_WHILE_0 \ /**/ // Like VERIFY_EQUAL, only differs for libopenmpt @@ -48,11 +48,11 @@ #define DO_TEST(func) \ - do { \ + MPT_DO { \ if(IsDebuggerPresent()) { \ func(); \ } \ - } while(0) \ + } MPT_WHILE_0 \ /**/ Modified: trunk/OpenMPT/test/test.cpp =================================================================== --- trunk/OpenMPT/test/test.cpp 2015-06-13 00:42:19 UTC (rev 5296) +++ trunk/OpenMPT/test/test.cpp 2015-06-13 11:59:24 UTC (rev 5297) @@ -932,19 +932,19 @@ _tcscpy(src_tchar, _T("ab")); #define MPT_TEST_PRINTF(dst_type, function, format, src_type) \ - do { \ + MPT_DO { \ MemsetZero(dst_ ## dst_type); \ function(dst_ ## dst_type, format, src_ ## src_type); \ VERIFY_EQUAL(std::memcmp(dst_ ## dst_type, src_ ## dst_type, 256), 0); \ - } while(0) \ + } MPT_WHILE_0 \ /**/ #define MPT_TEST_PRINTF_N(dst_type, function, format, src_type) \ - do { \ + MPT_DO { \ MemsetZero(dst_ ## dst_type); \ function(dst_ ## dst_type, 255, format, src_ ## src_type); \ VERIFY_EQUAL(std::memcmp(dst_ ## dst_type, src_ ## dst_type, 256), 0); \ - } while(0) \ + } MPT_WHILE_0 \ /**/ // CRT narrow This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-06-13 12:23:24
|
Revision: 5298 http://sourceforge.net/p/modplug/code/5298 Author: manxorist Date: 2015-06-13 12:23:20 +0000 (Sat, 13 Jun 2015) Log Message: ----------- [Ref] Another round of tiny MSVC W4 cleanups. Modified Paths: -------------- trunk/OpenMPT/common/BuildSettings.h trunk/OpenMPT/common/StringFixer.h trunk/OpenMPT/common/mptString.cpp trunk/OpenMPT/soundlib/Dither.cpp Modified: trunk/OpenMPT/common/BuildSettings.h =================================================================== --- trunk/OpenMPT/common/BuildSettings.h 2015-06-13 11:59:24 UTC (rev 5297) +++ trunk/OpenMPT/common/BuildSettings.h 2015-06-13 12:23:20 UTC (rev 5298) @@ -500,9 +500,6 @@ #if MPT_COMPILER_MSVC -// happens for if expression that only depend on template parameters -#pragma warning(disable:4127) // conditional expression is constant - // happens for immutable classes (i.e. classes containing const members) #pragma warning(disable:4512) // assignment operator could not be generated Modified: trunk/OpenMPT/common/StringFixer.h =================================================================== --- trunk/OpenMPT/common/StringFixer.h 2015-06-13 11:59:24 UTC (rev 5297) +++ trunk/OpenMPT/common/StringFixer.h 2015-06-13 12:23:20 UTC (rev 5298) @@ -20,6 +20,13 @@ namespace mpt { namespace String { + +#if MPT_COMPILER_MSVC +#pragma warning(push) +#pragma warning(disable:4127) // conditional expression is constant +#endif // MPT_COMPILER_MSVC + + // Sets last character to null in given char array. // Size of the array must be known at compile time. template <size_t size> @@ -383,6 +390,11 @@ } +#if MPT_COMPILER_MSVC +#pragma warning(pop) +#endif // MPT_COMPILER_MSVC + + } } // namespace mpt::String OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/common/mptString.cpp =================================================================== --- trunk/OpenMPT/common/mptString.cpp 2015-06-13 11:59:24 UTC (rev 5297) +++ trunk/OpenMPT/common/mptString.cpp 2015-06-13 12:23:20 UTC (rev 5298) @@ -791,7 +791,7 @@ charsleft--; if ( charsleft == 0 ) { - if ( sizeof( wchar_t ) == 2 ) { + MPT_CONSTANT_IF ( sizeof( wchar_t ) == 2 ) { if ( ucs4 > 0x1fffff ) { out.push_back( replacement ); ucs4 = 0; @@ -842,7 +842,7 @@ } uint32 ucs4 = 0; - if ( sizeof( wchar_t ) == 2 ) { + MPT_CONSTANT_IF ( sizeof( wchar_t ) == 2 ) { if ( i + 1 < in.length() ) { // check for surrogate pair uint16 hi_sur = in[i+0]; Modified: trunk/OpenMPT/soundlib/Dither.cpp =================================================================== --- trunk/OpenMPT/soundlib/Dither.cpp 2015-06-13 11:59:24 UTC (rev 5297) +++ trunk/OpenMPT/soundlib/Dither.cpp 2015-06-13 12:23:20 UTC (rev 5298) @@ -171,7 +171,7 @@ STATIC_ASSERT(sizeof(int) == 4); STATIC_ASSERT(FASTRAND_BITS * 3 >= (32-targetbits) - MIXING_ATTENUATION); const int rshift = (32-targetbits) - MIXING_ATTENUATION; - if(rshift <= 0) + MPT_CONSTANT_IF(rshift <= 0) { // nothing to dither return; @@ -186,7 +186,7 @@ for(std::size_t channel = 0; channel < channels; ++channel) { int noise = 0; - if(triangular) + MPT_CONSTANT_IF(triangular) { noise = (fastrandbits(s.rng, noise_bits) + fastrandbits(s.rng, noise_bits)) >> 1; } else @@ -195,7 +195,7 @@ } noise -= noise_bias; // un-bias int val = *mixbuffer; - if(shaped) + MPT_CONSTANT_IF(shaped) { val += (s.error[channel] >> 1); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-13 12:47:50
|
Revision: 5300 http://sourceforge.net/p/modplug/code/5300 Author: saga-games Date: 2015-06-13 12:47:42 +0000 (Sat, 13 Jun 2015) Log Message: ----------- [New] MPTM: In modern tempo mode, a swing factor can now be configured which determines how much every row of a beat contributes to the beat. This is done by increasing or decreasing the length of each tick as required. [Mod] OpenMPT: Version is now 1.25.00.14 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/AppendModule.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.h trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/SoundFilePlayConfig.h trunk/OpenMPT/soundlib/pattern.cpp trunk/OpenMPT/soundlib/pattern.h trunk/OpenMPT/soundlib/patternContainer.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/common/versionNumber.h 2015-06-13 12:47:42 UTC (rev 5300) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 25 #define VER_MINOR 00 -#define VER_MINORMINOR 13 +#define VER_MINORMINOR 14 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/AppendModule.cpp =================================================================== --- trunk/OpenMPT/mptrack/AppendModule.cpp 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/mptrack/AppendModule.cpp 2015-06-13 12:47:42 UTC (rev 5300) @@ -168,6 +168,7 @@ { SEQUENCEINDEX newSeq = m_SndFile.Order.AddSequence(false); m_SndFile.Order.SetSequence(newSeq); + m_SndFile.Order.GetSequence(newSeq).SetName(source.Order.GetSequence(seq).GetName()); insertPos = 0; } else { @@ -264,6 +265,18 @@ targetPat.SetSignature(source.m_nDefaultRowsPerBeat, source.m_nDefaultRowsPerMeasure); } } + if(m_SndFile.m_nTempoMode == tempoModeModern) + { + // Swing only works in modern tempo mode + if(sourcePat.HasTempoSwing()) + { + targetPat.SetTempoSwing(sourcePat.GetTempoSwing()); + } else if(source.m_tempoSwing != m_SndFile.m_tempoSwing) + { + // Try fixing differing swing settings by copying them to the newly created patterns + targetPat.SetTempoSwing(source.m_tempoSwing); + } + } const ROWINDEX copyRows = std::min(sourcePat.GetNumRows(), targetPat.GetNumRows()); for(ROWINDEX row = 0; row < copyRows; row++) Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2015-06-13 12:47:42 UTC (rev 5300) @@ -39,7 +39,7 @@ while(nCmdRow >= 0) { const ModCommand *m = sndFile.Patterns[nPat].GetpModCommand(nCmdRow, nChannel); - if(m->command == CMD_OFFSET || m->command == CMD_PATTERNBREAK || m->command == CMD_PATTERNBREAK) + if(m->command == CMD_OFFSET || m->command == CMD_PATTERNBREAK || m->command == CMD_TEMPO) break; if(m->command != CMD_XPARAM) { @@ -470,6 +470,7 @@ ON_COMMAND(IDC_BUTTON_HALF, OnHalfRowNumber) ON_COMMAND(IDC_BUTTON_DOUBLE, OnDoubleRowNumber) ON_COMMAND(IDC_CHECK1, OnOverrideSignature) + ON_COMMAND(IDC_BUTTON1, OnTempoSwing) END_MESSAGE_MAP() BOOL CPatternPropertiesDlg::OnInitDialog() @@ -483,7 +484,8 @@ if(m_nPattern < sndFile.Patterns.Size() && combo) { TCHAR s[256]; - UINT nrows = sndFile.Patterns[m_nPattern].GetNumRows(); + const CPattern &pattern = sndFile.Patterns[m_nPattern]; + ROWINDEX nrows = pattern.GetNumRows(); const CModSpecifications& specs = sndFile.GetModSpecifications(); combo->SetRedraw(FALSE); @@ -496,13 +498,13 @@ combo->SetRedraw(TRUE); _stprintf(s, _T("Pattern #%d: %d row%s (%dK)"), m_nPattern, - sndFile.Patterns[m_nPattern].GetNumRows(), - (sndFile.Patterns[m_nPattern].GetNumRows() == 1) ? _T("") : _T("s"), - (sndFile.Patterns[m_nPattern].GetNumRows() * sndFile.GetNumChannels() * sizeof(ModCommand)) / 1024); + pattern.GetNumRows(), + (pattern.GetNumRows() == 1) ? _T("") : _T("s"), + (pattern.GetNumRows() * sndFile.GetNumChannels() * sizeof(ModCommand)) / 1024); SetDlgItemText(IDC_TEXT1, s); // Window title - const CString patternName = sndFile.Patterns[m_nPattern].GetName().c_str(); + const CString patternName = pattern.GetName().c_str(); _stprintf(s, _T("Pattern Properties for Pattern #%d"), m_nPattern); if(!patternName.IsEmpty()) { @@ -513,15 +515,17 @@ SetWindowText(s); // pattern time signature - const bool bOverride = sndFile.Patterns[m_nPattern].GetOverrideSignature(); - UINT nRPB = sndFile.Patterns[m_nPattern].GetRowsPerBeat(), nRPM = sndFile.Patterns[m_nPattern].GetRowsPerMeasure(); + const bool bOverride = pattern.GetOverrideSignature(); + ROWINDEX nRPB = pattern.GetRowsPerBeat(), nRPM = pattern.GetRowsPerMeasure(); if(nRPB == 0 || !bOverride) nRPB = sndFile.m_nDefaultRowsPerBeat; if(nRPM == 0 || !bOverride) nRPM = sndFile.m_nDefaultRowsPerMeasure; + m_tempoSwing = pattern.HasTempoSwing() ? pattern.GetTempoSwing() : sndFile.m_tempoSwing; + GetDlgItem(IDC_CHECK1)->EnableWindow(sndFile.GetModSpecifications().hasPatternSignatures ? TRUE : FALSE); CheckDlgButton(IDC_CHECK1, bOverride ? MF_CHECKED : MF_UNCHECKED); - SetDlgItemInt(IDC_EDIT_ROWSPERBEAT, nRPB, FALSE); - SetDlgItemInt(IDC_EDIT_ROWSPERMEASURE, nRPM, FALSE); + SetDlgItemInt(IDC_ROWSPERBEAT, nRPB, FALSE); + SetDlgItemInt(IDC_ROWSPERMEASURE, nRPM, FALSE); OnOverrideSignature(); } return TRUE; @@ -556,41 +560,59 @@ void CPatternPropertiesDlg::OnOverrideSignature() //----------------------------------------------- -{ - GetDlgItem(IDC_EDIT_ROWSPERBEAT)->EnableWindow(IsDlgButtonChecked(IDC_CHECK1)); - GetDlgItem(IDC_EDIT_ROWSPERMEASURE)->EnableWindow(IsDlgButtonChecked(IDC_CHECK1)); +{ + GetDlgItem(IDC_ROWSPERBEAT)->EnableWindow(IsDlgButtonChecked(IDC_CHECK1)); + GetDlgItem(IDC_ROWSPERMEASURE)->EnableWindow(IsDlgButtonChecked(IDC_CHECK1)); + GetDlgItem(IDC_BUTTON1)->EnableWindow(IsDlgButtonChecked(IDC_CHECK1) && modDoc.GetrSoundFile().m_nTempoMode == tempoModeModern); } +void CPatternPropertiesDlg::OnTempoSwing() +//---------------------------------------- +{ + m_tempoSwing.resize(GetDlgItemInt(IDC_ROWSPERBEAT), TempoSwing::Unity); + CTempoSwingDlg dlg(this, m_tempoSwing); + if(dlg.DoModal() == IDOK) + { + m_tempoSwing = dlg.m_tempoSwing; + } +} + + void CPatternPropertiesDlg::OnOK() //-------------------------------- { CSoundFile &sndFile = modDoc.GetrSoundFile(); + CPattern &pattern = sndFile.Patterns[m_nPattern]; // Update pattern signature if necessary if(sndFile.GetModSpecifications().hasPatternSignatures) { if(IsDlgButtonChecked(IDC_CHECK1)) // Enable signature { - ROWINDEX nNewBeat = (ROWINDEX)GetDlgItemInt(IDC_EDIT_ROWSPERBEAT, NULL, FALSE), nNewMeasure = (ROWINDEX)GetDlgItemInt(IDC_EDIT_ROWSPERMEASURE, NULL, FALSE); - if(nNewBeat != sndFile.Patterns[m_nPattern].GetRowsPerBeat() || nNewMeasure != sndFile.Patterns[m_nPattern].GetRowsPerMeasure()) + ROWINDEX nNewBeat = (ROWINDEX)GetDlgItemInt(IDC_ROWSPERBEAT, NULL, FALSE), nNewMeasure = (ROWINDEX)GetDlgItemInt(IDC_ROWSPERMEASURE, NULL, FALSE); + if(nNewBeat != pattern.GetRowsPerBeat() || nNewMeasure != pattern.GetRowsPerMeasure() || m_tempoSwing != pattern.GetTempoSwing()) { - if(!sndFile.Patterns[m_nPattern].SetSignature(nNewBeat, nNewMeasure)) + if(!pattern.SetSignature(nNewBeat, nNewMeasure)) { Reporting::Error("Invalid time signature!", "Pattern Properties"); - GetDlgItem(IDC_EDIT_ROWSPERBEAT)->SetFocus(); + GetDlgItem(IDC_ROWSPERBEAT)->SetFocus(); return; } + m_tempoSwing.resize(nNewBeat, TempoSwing::Unity); + pattern.SetTempoSwing(m_tempoSwing); modDoc.SetModified(); } } else // Disable signature { - if(sndFile.Patterns[m_nPattern].GetOverrideSignature()) + if(pattern.GetOverrideSignature() || pattern.HasTempoSwing()) { - sndFile.Patterns[m_nPattern].RemoveSignature(); + pattern.RemoveSignature(); + pattern.RemoveTempoSwing(); modDoc.SetModified(); } } } + const ROWINDEX newSize = (ROWINDEX)GetDlgItemInt(IDC_COMBO1, NULL, FALSE); Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.h =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2015-06-13 12:47:42 UTC (rev 5300) @@ -96,10 +96,15 @@ { protected: CModDoc &modDoc; + TempoSwing m_tempoSwing; PATTERNINDEX m_nPattern; public: - CPatternPropertiesDlg(CModDoc &modParent, PATTERNINDEX nPat, CWnd *parent=NULL):CDialog(IDD_PATTERN_PROPERTIES, parent), modDoc(modParent), m_nPattern(nPat) { } + CPatternPropertiesDlg(CModDoc &modParent, PATTERNINDEX nPat, CWnd *parent=NULL) + : CDialog(IDD_PATTERN_PROPERTIES, parent) + , modDoc(modParent) + , m_nPattern(nPat) + { } protected: virtual BOOL OnInitDialog(); @@ -107,6 +112,7 @@ afx_msg void OnHalfRowNumber(); afx_msg void OnDoubleRowNumber(); afx_msg void OnOverrideSignature(); + afx_msg void OnTempoSwing(); DECLARE_MESSAGE_MAP() }; Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-06-13 12:47:42 UTC (rev 5300) @@ -31,8 +31,10 @@ BEGIN_MESSAGE_MAP(CModTypeDlg, CDialog) //{{AFX_MSG_MAP(CModTypeDlg) - ON_CBN_SELCHANGE(IDC_COMBO1, UpdateDialog) - ON_COMMAND(IDC_CHECK_PT1X, OnPTModeChanged) + ON_CBN_SELCHANGE(IDC_COMBO1, UpdateDialog) + ON_CBN_SELCHANGE(IDC_COMBO_TEMPOMODE, OnTempoModeChanged) + ON_COMMAND(IDC_CHECK_PT1X, OnPTModeChanged) + ON_COMMAND(IDC_BUTTON1, OnTempoSwing) ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify) @@ -69,6 +71,7 @@ CDialog::OnInitDialog(); m_nType = sndFile.GetType(); m_nChannels = sndFile.GetNumChannels(); + m_tempoSwing = sndFile.m_tempoSwing; initialized = false; // Mod types @@ -220,6 +223,7 @@ break; } } + OnTempoModeChanged(); // Mix levels const MixLevels oldMixLevels = initialized ? static_cast<MixLevels>(m_PlugMixBox.GetItemData(m_PlugMixBox.GetCurSel())) : sndFile.GetMixLevels(); @@ -270,6 +274,25 @@ } +void CModTypeDlg::OnTempoModeChanged() +//------------------------------------ +{ + GetDlgItem(IDC_BUTTON1)->EnableWindow(m_TempoModeBox.GetItemData(m_TempoModeBox.GetCurSel()) == tempoModeModern); +} + + +void CModTypeDlg::OnTempoSwing() +//------------------------------ +{ + m_tempoSwing.resize(GetDlgItemInt(IDC_ROWSPERBEAT), TempoSwing::Unity); + CTempoSwingDlg dlg(this, m_tempoSwing); + if(dlg.DoModal() == IDOK) + { + m_tempoSwing = dlg.m_tempoSwing; + } +} + + bool CModTypeDlg::VerifyData() //---------------------------- { @@ -332,11 +355,23 @@ m_nChannels = static_cast<CHANNELINDEX>(m_ChannelsBox.GetItemData(sel)); } + sndFile.m_nDefaultRowsPerBeat = GetDlgItemInt(IDC_ROWSPERBEAT); + sndFile.m_nDefaultRowsPerMeasure = GetDlgItemInt(IDC_ROWSPERMEASURE); + sel = m_TempoModeBox.GetCurSel(); if (sel >= 0) { sndFile.m_nTempoMode = static_cast<TempoMode>(m_TempoModeBox.GetItemData(sel)); } + if(sndFile.m_nTempoMode == tempoModeModern) + { + sndFile.m_tempoSwing = m_tempoSwing; + sndFile.m_tempoSwing.resize(sndFile.m_nDefaultRowsPerBeat, TempoSwing::Unity); + sndFile.m_tempoSwing.Normalize(); + } else + { + sndFile.m_tempoSwing.clear(); + } sel = m_PlugMixBox.GetCurSel(); if(sel >= 0) @@ -354,9 +389,6 @@ if(IsDlgButtonChecked(IDC_CHK_FT2VOLRAMP)) sndFile.SetModFlag(MSF_VOLRAMP, true); } - sndFile.m_nDefaultRowsPerBeat = GetDlgItemInt(IDC_ROWSPERBEAT); - sndFile.m_nDefaultRowsPerMeasure = GetDlgItemInt(IDC_ROWSPERMEASURE); - if(CChannelManagerDlg::sharedInstance(FALSE) && CChannelManagerDlg::sharedInstance()->IsDisplayed()) CChannelManagerDlg::sharedInstance()->Update(); CDialog::OnOK(); @@ -479,10 +511,10 @@ if (m_nRemove > 0) { - wsprintf(label, "Select %d channel%s to remove:", m_nRemove, (m_nRemove != 1) ? "s" : ""); + wsprintf(label, "Select %u channel%s to remove:", m_nRemove, (m_nRemove != 1) ? "s" : ""); } else { - wsprintf(label, "Select channels to remove (the minimum number of remaining channels is %d)", sndFile.GetModSpecifications().channelsMin); + wsprintf(label, "Select channels to remove (the minimum number of remaining channels is %u)", sndFile.GetModSpecifications().channelsMin); } SetDlgItemText(IDC_QUESTION1, label); @@ -1160,6 +1192,186 @@ } + +///////////////////////////////////////////////////////////////////////// +// Tempo swing dialog + + +BEGIN_MESSAGE_MAP(CTempoSwingDlg, CDialog) + //{{AFX_MSG_MAP(CTempoSwingDlg) + ON_WM_HSCROLL() + ON_COMMAND(IDC_BUTTON1, OnReset) + ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + + +BOOL CTempoSwingDlg::OnInitDialog() +//----------------------------------- +{ + struct Measurements + { + enum + { + edRowLabelWidth = 64, // Label "Row 999:" + edSliderWidth = 220, // Setting slider + edSliderHeight = 20, // Setting slider + edValueLabelWidth = 64, // Label "100%" + edPaddingX = 8, // Spacing between elements + edPaddingY = 4, // Spacing between elements + edPaddingTop = 35, // Topping from top of dialog + edTotalHeight = edSliderHeight + edPaddingY, // Height of one set of controls + edFooterHeight = 32, // Buttons + }; + + const int rowLabelWidth; + const int sliderWidth; + const int sliderHeight; + const int valueLabelWidth; + const int paddingX; + const int paddingY; + const int paddingTop; + const int totalHeight; + const int footerHeight; + + Measurements(HWND hWnd) + : rowLabelWidth(Util::ScalePixels(edRowLabelWidth, hWnd)) + , sliderWidth(Util::ScalePixels(edSliderWidth, hWnd)) + , sliderHeight(Util::ScalePixels(edSliderHeight, hWnd)) + , valueLabelWidth(Util::ScalePixels(edValueLabelWidth, hWnd)) + , paddingX(Util::ScalePixels(edPaddingX, hWnd)) + , paddingY(Util::ScalePixels(edPaddingY, hWnd)) + , paddingTop(Util::ScalePixels(edPaddingTop, hWnd)) + , totalHeight(Util::ScalePixels(edTotalHeight, hWnd)) + , footerHeight(Util::ScalePixels(edFooterHeight, hWnd)) + { } + }; + + CDialog::OnInitDialog(); + Measurements m(m_hWnd); + CRect windowRect, rect; + GetWindowRect(windowRect); + GetClientRect(rect); + windowRect.bottom = windowRect.top + windowRect.Height() - rect.Height(); + rect.DeflateRect(m.paddingX, m.paddingTop, m.paddingX, 0); + m_controls.resize(m_tempoSwing.size()); + for(size_t i = 0; i < m_controls.size(); i++) + { + RowCtls *r = m_controls[i] = new RowCtls; + // Parameter name + TCHAR s[16]; + wsprintf(s, "Row %u:", i + 1); + r->rowLabel.Create(s, WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, CRect(rect.left, rect.top, rect.left + m.rowLabelWidth, rect.top + m.sliderHeight), this); + r->rowLabel.SetFont(GetFont()); + + // Parameter value as reported by the plugin + r->valueLabel.Create(_T("100%"), WS_CHILD | WS_VISIBLE | SS_CENTERIMAGE, CRect(rect.right - m.valueLabelWidth, rect.top, rect.right, rect.top + m.sliderHeight), this); + r->valueLabel.SetFont(GetFont()); + + // Parameter value slider + r->valueSlider.Create(WS_CHILD | WS_VISIBLE | WS_TABSTOP | TBS_TOOLTIPS | TBS_AUTOTICKS, CRect(rect.left + m.rowLabelWidth, rect.top, rect.right - m.valueLabelWidth, rect.top + m.sliderHeight), this, ID_PLUGINEDITOR_SLIDERS_BASE + i); + r->valueSlider.SetFont(GetFont()); + r->valueSlider.SetRange(-SliderResolution / 2, SliderResolution / 2); + r->valueSlider.SetTicFreq(SliderResolution / 8); + r->valueSlider.SetPageSize(SliderResolution / 8); + int32 val = Util::muldivr(static_cast<int32>(m_tempoSwing[i]) - TempoSwing::Unity, SliderUnity, TempoSwing::Unity); + r->valueSlider.SetPos(val); + rect.MoveToY(rect.top + m.totalHeight); + } + OnHScroll(0, 0, nullptr); + rect.MoveToY(rect.top + m.paddingY); + { + CRect buttonRect; + GetDlgItem(IDOK)->GetWindowRect(buttonRect); + GetDlgItem(IDOK)->SetWindowPos(nullptr, buttonRect.left - windowRect.left - GetSystemMetrics(SM_CXEDGE), rect.top, 0, 0, SWP_NOSIZE | SWP_NOOWNERZORDER); + GetDlgItem(IDCANCEL)->GetWindowRect(buttonRect); + GetDlgItem(IDCANCEL)->SetWindowPos(nullptr, buttonRect.left - windowRect.left - GetSystemMetrics(SM_CXEDGE), rect.top, 0, 0, SWP_NOSIZE | SWP_NOOWNERZORDER); + } + + windowRect.bottom += rect.top + m.footerHeight; + SetWindowPos(nullptr, 0, 0, windowRect.Width(), windowRect.Height(), SWP_NOMOVE | SWP_NOOWNERZORDER); + EnableToolTips(); + + return TRUE; +} + + +void CTempoSwingDlg::OnOK() +//--------------------------- +{ + CDialog::OnOK(); + // If this is the default setup, just clear the vector. + if(static_cast<size_t>(std::count(m_tempoSwing.begin(), m_tempoSwing.end(), TempoSwing::Unity)) == m_tempoSwing.size()) + { + m_tempoSwing.clear(); + } + OnClose(); +} + + +void CTempoSwingDlg::OnCancel() +//--------------------------- +{ + CDialog::OnCancel(); + OnClose(); +} + + +void CTempoSwingDlg::OnClose() +//------------------------------ +{ + for(size_t i = 0; i < m_controls.size(); i++) + { + delete m_controls[i]; + } +} + + +void CTempoSwingDlg::OnReset() +//------------------------------ +{ + for(size_t i = 0; i < m_controls.size(); i++) + { + m_controls[i]->valueSlider.SetPos(0); + } + OnHScroll(0, 0, nullptr); +} + + +void CTempoSwingDlg::OnHScroll(UINT /*nSBCode*/, UINT /*nPos*/, CScrollBar* /*pScrollBar*/) +//------------------------------------------------------------------------------------------- +{ + for(size_t i = 0; i < m_controls.size(); i++) + { + m_tempoSwing[i] = Util::muldivr(m_controls[i]->valueSlider.GetPos(), TempoSwing::Unity, SliderUnity) + TempoSwing::Unity; + } + m_tempoSwing.Normalize(); + for(size_t i = 0; i < m_tempoSwing.size(); i++) + { + TCHAR s[32]; + wsprintf(s, _T("%u%%"), Util::muldivr(m_tempoSwing[i], 100, TempoSwing::Unity)); + m_controls[i]->valueLabel.SetWindowText(s); + } +} + + +BOOL CTempoSwingDlg::OnToolTipNotify(UINT, NMHDR *pNMHDR, LRESULT *) +//-------------------------------------------------------------------- +{ + TOOLTIPTEXT *pTTT = (TOOLTIPTEXTA*)pNMHDR; + for(size_t i = 0; i < m_controls.size(); i++) + { + if((HWND)pNMHDR->idFrom == m_controls[i]->valueSlider.m_hWnd) + { + int32 val = Util::muldivr(m_tempoSwing[i], 100, TempoSwing::Unity) - 100; + wsprintf(pTTT->szText, _T("%s%d"), val > 0 ? _T("+") : _T(""), val); + return TRUE; + } + } + return FALSE; +} + + /////////////////////////////////////////////////////////////////////////////////////// // Messagebox with 'don't show again'-option. Modified: trunk/OpenMPT/mptrack/dlg_misc.h =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.h 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/mptrack/dlg_misc.h 2015-06-13 12:47:42 UTC (rev 5300) @@ -26,6 +26,7 @@ CComboBox m_TypeBox, m_ChannelsBox, m_TempoModeBox, m_PlugMixBox; CButton m_CheckBox1, m_CheckBox2, m_CheckBox3, m_CheckBox4, m_CheckBox5, m_CheckBoxPT1x, m_CheckBoxFt2VolRamp, m_CheckBoxAmigaLimits; CSoundFile &sndFile; + TempoSwing m_tempoSwing; CHANNELINDEX m_nChannels; MODTYPE m_nType; bool initialized; @@ -35,6 +36,8 @@ bool VerifyData(); void UpdateDialog(); void OnPTModeChanged(); + void OnTempoModeChanged(); + void OnTempoSwing(); protected: void UpdateChannelCBox(); @@ -196,7 +199,7 @@ protected: virtual void DoDataExchange(CDataExchange* pDX); virtual BOOL OnInitDialog(); - virtual VOID OnOK(); + virtual void OnOK(); afx_msg void OnUpdateSamples(); afx_msg void OnUpdateKeyboard(); afx_msg void OnUpdateOctave(); @@ -222,7 +225,7 @@ protected: virtual BOOL OnInitDialog(); - virtual VOID OnOK(); + virtual void OnOK(); afx_msg void OnClearHistory(); DECLARE_MESSAGE_MAP() }; @@ -261,6 +264,39 @@ ///////////////////////////////////////////////////////////////////////// +// Tempo swing dialog + +//================================== +class CTempoSwingDlg: public CDialog +//================================== +{ +protected: + enum { SliderResolution = 1000, SliderUnity = SliderResolution / 2 }; + struct RowCtls + { + CStatic rowLabel, valueLabel; + CSliderCtrl valueSlider; + }; + std::vector<RowCtls *> m_controls; +public: + TempoSwing m_tempoSwing; + +public: + CTempoSwingDlg(CWnd *parent, const TempoSwing &tempoSwing) : CDialog(IDD_TEMPO_SWING, parent), m_tempoSwing(tempoSwing) { } + +protected: + virtual BOOL OnInitDialog(); + virtual void OnOK(); + virtual void OnCancel(); + void OnClose(); + afx_msg void OnReset(); + afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); + afx_msg BOOL OnToolTipNotify(UINT, NMHDR *pNMHDR, LRESULT *); + DECLARE_MESSAGE_MAP() +}; + + +///////////////////////////////////////////////////////////////////////// // Messagebox with 'don't show again'-option. // Enums for message entries. See dlg_misc.cpp for the array of entries. Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/mptrack/mptrack.rc 2015-06-13 12:47:42 UTC (rev 5300) @@ -361,6 +361,18 @@ END +IDD_TEMPO_SWING DIALOGEX 0, 0, 246, 143 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Tempo Swing Settings" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,132,120,50,14 + PUSHBUTTON "Cancel",IDCANCEL,186,120,50,14 + LTEXT "Configure how much each row contributes to a beat:",IDC_STATIC,6,9,174,8 + PUSHBUTTON "Reset",IDC_BUTTON1,186,6,50,14 +END + + ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -520,6 +532,14 @@ TOPMARGIN, 7 BOTTOMMARGIN, 130 END + + IDD_TEMPO_SWING, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 239 + TOPMARGIN, 7 + BOTTOMMARGIN, 136 + END END #endif // APSTUDIO_INVOKED @@ -1108,12 +1128,13 @@ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,156,222,12 CONTROL "Plugin volume command &bug emulation",IDC_CHK_MIDICCBUG, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,167,222,12 - LTEXT "&Tempo Mode:",IDC_TEXT_TEMPOMODE,12,204,44,8 - COMBOBOX IDC_COMBO_TEMPOMODE,12,215,108,77,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Rows per beat",IDC_TEXT_ROWSPERBEAT,162,206,84,8 - EDITTEXT IDC_ROWSPERBEAT,132,204,24,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Rows per measure",IDC_TEXT_ROWSPERMEASURE,162,223,84,8 - EDITTEXT IDC_ROWSPERMEASURE,132,222,24,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "&Tempo Mode:",IDC_TEXT_TEMPOMODE,12,206,44,8 + COMBOBOX IDC_COMBO_TEMPOMODE,62,204,82,77,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Configure S&wing",IDC_BUTTON1,62,222,82,12 + LTEXT "Rows per beat",IDC_TEXT_ROWSPERBEAT,180,206,66,8 + EDITTEXT IDC_ROWSPERBEAT,150,204,24,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Rows per measure",IDC_TEXT_ROWSPERMEASURE,180,223,66,8 + EDITTEXT IDC_ROWSPERMEASURE,150,222,24,12,ES_AUTOHSCROLL | ES_NUMBER RTEXT "Created with:",IDC_TEXT_CREATEDWITH,12,260,60,8 EDITTEXT IDC_EDIT_CREATEDWITH,78,258,166,13,ES_AUTOHSCROLL | ES_READONLY,WS_EX_STATICEDGE RTEXT "Last saved with:",IDC_TEXT_SAVEDWITH,12,276,60,8 @@ -1300,18 +1321,19 @@ CAPTION "Pattern Properties" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN + DEFPUSHBUTTON "&OK",IDOK,132,6,50,14 + PUSHBUTTON "&Cancel",IDCANCEL,132,24,50,14 + LTEXT "Rows:",IDC_STATIC,6,6,108,8 COMBOBOX IDC_COMBO1,6,18,48,93,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&/2",IDC_BUTTON_HALF,60,18,18,12 PUSHBUTTON "&x2",IDC_BUTTON_DOUBLE,84,18,18,12 - CONTROL "Override &song signature:",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,48,174,12 - EDITTEXT IDC_EDIT_ROWSPERBEAT,18,66,30,12,ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_EDIT_ROWSPERMEASURE,18,84,30,12,ES_AUTOHSCROLL | ES_NUMBER - DEFPUSHBUTTON "&OK",IDOK,132,6,50,14 - PUSHBUTTON "&Cancel",IDCANCEL,132,24,50,14 - LTEXT "Rows:",IDC_STATIC,6,6,108,8 CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,6,42,174,1 + CONTROL "Override &song signature:",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,48,108,12 + PUSHBUTTON "Configure S&wing",IDC_BUTTON1,114,48,66,12 LTEXT "Rows per beat",IDC_STATIC,54,68,126,8 + EDITTEXT IDC_ROWSPERBEAT,18,66,30,12,ES_AUTOHSCROLL | ES_NUMBER LTEXT "Rows per measure",IDC_STATIC,54,86,126,8 + EDITTEXT IDC_ROWSPERMEASURE,18,84,30,12,ES_AUTOHSCROLL | ES_NUMBER CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,6,102,174,1 LTEXT "Pattern Info",IDC_TEXT1,6,108,174,14 END Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/mptrack/resource.h 2015-06-13 12:47:42 UTC (rev 5300) @@ -133,6 +133,7 @@ #define IDD_RESAMPLE 537 #define IDD_MISSINGSAMPLES 538 #define IDD_WECLOME 539 +#define IDD_TEMPO_SWING 540 #define IDC_BUTTON1 1001 #define IDC_BUTTON2 1002 #define IDC_BUTTON3 1003 @@ -911,8 +912,6 @@ #define IDC_LIST_SAMPLEGEN_PRESETS 2425 #define IDC_CHECK_UNDO 2426 #define IDC_CHK_REMEMBERSETTINGS 2427 -#define IDC_EDIT_ROWSPERBEAT 2428 -#define IDC_EDIT_ROWSPERMEASURE 2429 #define IDC_BTN_CLEAR 2430 #define IDC_TOTAL_EDIT_TIME 2431 #define IDC_EDIT_HISTORY 2432 @@ -1257,7 +1256,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 540 +#define _APS_NEXT_RESOURCE_VALUE 541 #define _APS_NEXT_COMMAND_VALUE 44645 #define _APS_NEXT_CONTROL_VALUE 2483 #define _APS_NEXT_SYMED_VALUE 901 Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2015-06-13 12:47:42 UTC (rev 5300) @@ -1072,7 +1072,7 @@ { size_t num = pSndFile->GetFileHistory().size(); #ifdef MODPLUG_TRACKER - CModDoc *pModDoc = pSndFile->GetpModDoc(); + const CModDoc *pModDoc = pSndFile->GetpModDoc(); num += (pModDoc != nullptr) ? 1 : 0; // + 1 for this session #endif // MODPLUG_TRACKER @@ -2024,6 +2024,17 @@ } } + // Tempo Swing Factors + if(!m_tempoSwing.empty()) + { + std::ostringstream oStrm; + TempoSwing::Serialize(oStrm, m_tempoSwing); + std::string data = oStrm.str(); + uint16 length = mpt::saturate_cast<uint16>(data.size()); + WRITEMODULARHEADER(MAGIC4LE('S','W','N','G'), length); + mpt::IO::WriteRaw(f, &data[0], length); + } + // Additional flags for XM/IT/MPTM if(m_ModFlags) { @@ -2182,25 +2193,35 @@ } } break; + + case MAGIC4LE('S','W','N','G'): + // Tempo Swing Factors + if(size > 2) + { + std::string data(chunk.GetLength(), '\0'); + chunk.ReadRaw(&data[0], data.size()); + std::istringstream iStrm(data); + TempoSwing::Deserialize(iStrm, m_tempoSwing, data.size()); + } + break; } } // Validate read values. Limit(m_nDefaultTempo, GetModSpecifications().tempoMin, GetModSpecifications().tempoMax); - //m_nRowsPerBeat - //m_nRowsPerMeasure + if(m_nDefaultRowsPerMeasure < m_nDefaultRowsPerBeat) m_nDefaultRowsPerMeasure = m_nDefaultRowsPerBeat; Limit(m_nChannels, CHANNELINDEX(1), GetModSpecifications().channelsMax); - //m_nTempoMode - //m_nMixLevels + if(m_nTempoMode >= tempoModeMax) m_nTempoMode = tempoModeClassic; + if(m_nMixLevels >= mixLevelsMax) m_nMixLevels = mixLevelsOriginal; //m_dwCreatedWithVersion //m_dwLastSavedWithVersion //m_nSamplePreAmp //m_nVSTiVolume - //m_nDefaultGlobalVolume); + //m_nDefaultGlobalVolume + LimitMax(m_nDefaultGlobalVolume, MAX_GLOBAL_VOLUME); //m_nRestartPos //m_ModFlags - } @@ -2209,6 +2230,18 @@ size_t CSoundFile::SaveModularInstrumentData(FILE *f, const ModInstrument *pIns) const //------------------------------------------------------------------------------------ { + // Yes, it is completely idiotic that we have both SaveModularInstrumentData and SaveExtendedInstrumentProperties. + // And they are all insane in their own way: + // - SaveExtendedInstrumentProperties is tacked SOMEWHERE AFTER THE SAMPLE CHUNK, which is horrible in case of + // compressed samples because you don't know where to start reading without actually unpacking the sample. + // this mechanism has broken a gazillion times in the past due to simple code changes. Luckily we have unit + // tests which can detect this most of the time. + // - SaveModularInstrumentData follows the instrument data as it should, but is used for only one chunk, and + // it doesn't actually specify the chunk's size. You have to hardcode chunk size or else you're lost. + // That's totally awesome if you have to process unknown chunks. NOT. + // Oh, and of course they all use backwards FOURCCs because they originally used the non-standard '1234' + // multi-char MSVC extension. It's one big clusterfuck. + // As the only stuff that is actually written here is the plugin ID, // we can actually chicken out if there's no plugin. if(!pIns->nMixPlug) @@ -2218,30 +2251,18 @@ uint32 modularInstSize = 0; uint32 id = MAGIC4BE('I','N','S','M'); - SwapBytesLE(id); - fwrite(&id, 1, sizeof(id), f); // mark this as an instrument with modular extensions - long sizePos = ftell(f); // we will want to write the modular data's total size here - fwrite(&modularInstSize, 1, sizeof(modularInstSize), f); // write a DUMMY size, just to move file pointer by a long + mpt::IO::WriteIntLE<uint32>(f, id); + long sizePos = ftell(f); // we will want to write the modular data's total size here + mpt::IO::WriteIntLE<uint32>(f, 0); // write a DUMMY size, just to move file pointer by a long // Write chunks { //VST Slot chunk: - id = MAGIC4BE('P','L','U','G'); - SwapBytesLE(id); - fwrite(&id, 1, sizeof(uint32), f); - fwrite(&(pIns->nMixPlug), 1, sizeof(uint8), f); + mpt::IO::WriteIntLE<uint32>(f, MAGIC4BE('P','L','U','G')); + mpt::IO::WriteIntLE<uint8>(f, pIns->nMixPlug); modularInstSize += sizeof(uint32) + sizeof(uint8); } - //How to save your own modular instrument chunk: -/* { - ID='MYID'; - fwrite(&ID, 1, sizeof(int), f); - instModularDataSize+=sizeof(int); + // If you really need to add more chunks here, please don't repeat history (see above) and *do* add a size field for your chunk, mmmkay? - //You can save your chunk size somwhere here if you need variable chunk size. - fwrite(myData, 1, myDataSize, f); - instModularDataSize+=myDataSize; - } -*/ //write modular data's total size long curPos = ftell(f); // remember current pos fseek(f, sizePos, SEEK_SET); // go back to sizePos @@ -2272,18 +2293,20 @@ while(modularData.AreBytesLeft()) { const uint32 chunkID = modularData.ReadUint32LE(); + uint16 chunkSize; + // Legacy chunk + if(chunkID == MAGIC4BE('P','L','U','G')) + chunkSize = 1; + else + chunkSize = modularData.ReadUint16LE(); + FileReader chunkData = modularData.ReadChunk(chunkSize); switch (chunkID) { case MAGIC4BE('P','L','U','G'): - // Chunks don't tell us their length - stupid! - ins.nMixPlug = modularData.ReadUint8(); + ins.nMixPlug = chunkData.ReadUint8(); break; - default: - // move forward one byte and try to recognize again. - modularData.Skip(1); - } } Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2015-06-13 12:47:42 UTC (rev 5300) @@ -363,7 +363,22 @@ }; +// Tempo swing determines how much every row in modern tempo mode contributes to a beat. +class TempoSwing : public std::vector<uint32> +{ +public: + enum { Unity = 1u << 24 }; + // Normalize the tempo swing coefficients so that they add up to exactly the specified tempo again + void Normalize(); + + static void Serialize(std::ostream &oStrm, const TempoSwing &swing); + static void Deserialize(std::istream& iStrm, TempoSwing &swing, const size_t); +}; + + // Fixed-point type, e.g. used for fractional tempos +// Note that this doesn't use classical bit shifting for the fixed point part. +// This is mostly for the clarity of stored values and to be able to represent any value .0000 to .9999 properly. template<size_t FFact, typename T> struct FPInt { Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2015-06-13 12:47:42 UTC (rev 5300) @@ -96,15 +96,12 @@ gnDryROfsVol = 0; m_nType = MOD_TYPE_NONE; m_ContainerType = MOD_CONTAINERTYPE_NONE; - m_nChannels = 0; m_nMixChannels = 0; m_nSamples = 0; m_nInstruments = 0; #ifndef MODPLUG_TRACKER m_nFreqFactor = m_nTempoFactor = 65536; #endif - m_nMinPeriod = 32; - m_nMaxPeriod = 0x7FFF; m_nRepeatCount = 0; m_PlayState.m_nSeqOverride = ORDERINDEX_INVALID; m_PlayState.m_bPatternTransitionOccurred = false; @@ -123,9 +120,6 @@ m_nDefaultRowsPerMeasure = m_PlayState.m_nCurrentRowsPerMeasure = 16; #endif // MODPLUG_TRACKER - m_dwLastSavedWithVersion=0; - m_dwCreatedWithVersion=0; - MemsetZero(m_PlayState.ChnMix); MemsetZero(Instruments); MemsetZero(m_szNames); @@ -197,6 +191,7 @@ songMessage.clear(); madeWithTracker.clear(); m_FileHistory.clear(); + m_tempoSwing.clear(); } @@ -1358,6 +1353,13 @@ case tempoModeModern: { double accurateBufferCount = static_cast<double>(m_MixerSettings.gdwMixingFreq) * (60.0 / playState.m_nMusicTempo.ToDouble() / (static_cast<double>(playState.m_nMusicSpeed * playState.m_nCurrentRowsPerBeat))); + const TempoSwing &swing = Patterns[playState.m_nPattern].HasTempoSwing() ? Patterns[playState.m_nPattern].GetTempoSwing() : m_tempoSwing; + if(!swing.empty()) + { + // Apply current row's tempo swing factor + TempoSwing::value_type swingFactor = swing[playState.m_nRow % m_tempoSwing.size()]; + accurateBufferCount = accurateBufferCount * swingFactor / double(TempoSwing::Unity); + } uint32 bufferCount = static_cast<int>(accurateBufferCount); playState.m_dBufferDiff += accurateBufferCount - bufferCount; @@ -1592,4 +1594,52 @@ } +// Normalize the tempo swing coefficients so that they add up to exactly the specified tempo again +void TempoSwing::Normalize() +//-------------------------- +{ + if(empty()) return; + int64 sum = 0, remain = Unity * size(); + for(iterator i = begin(); i != end(); i++) + { + Limit(*i, Unity / 4u, Unity * 4u); + sum += *i; + } + sum = sum / size(); + for(iterator i = begin(); i != end(); i++) + { + *i = Util::muldivr(*i, Unity, static_cast<int32>(sum)); + remain -= *i; + } + MPT_ASSERT(abs(remain) <= size()); + at(0) += static_cast<int32>(remain); +} + + +void TempoSwing::Serialize(std::ostream &oStrm, const TempoSwing &swing) +//---------------------------------------------------------------------- +{ + mpt::IO::WriteIntLE<uint16>(oStrm, static_cast<uint16>(swing.size())); + for(std::size_t i = 0; i < swing.size(); i++) + { + mpt::IO::WriteIntLE<uint32>(oStrm, swing[i]); + } +} + + +void TempoSwing::Deserialize(std::istream& iStrm, TempoSwing &swing, const size_t) +//-------------------------------------------------------------------------------- +{ + uint16 numEntries; + mpt::IO::ReadIntLE<uint16>(iStrm, numEntries); + swing.resize(numEntries); + for(uint16 i = 0; i < numEntries; i++) + { + mpt::IO::ReadIntLE<uint32>(iStrm, swing[i]); + } + swing.Normalize(); +} + + + OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/soundlib/Sndfile.h 2015-06-13 12:47:42 UTC (rev 5300) @@ -428,6 +428,9 @@ uint32 m_nTempoFactor; // Tempo factor (65536 = no tempo adjustment). Only used in libopenmpt (openmpt::ext::interactive::set_tempo_factor) #endif + // Row swing factors for modern tempo mode + TempoSwing m_tempoSwing; + // Min Period = highest possible frequency, Max Period = lowest possible frequency for current format // Note: Period is an Amiga metric that is inverse to frequency. // Periods in MPT are 4 times as fine as Amiga periods because of extra fine frequency slides (introduced in the S3M format). Modified: trunk/OpenMPT/soundlib/SoundFilePlayConfig.h =================================================================== --- trunk/OpenMPT/soundlib/SoundFilePlayConfig.h 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/soundlib/SoundFilePlayConfig.h 2015-06-13 12:47:42 UTC (rev 5300) @@ -3,8 +3,7 @@ * --------------------- * Purpose: Configuration of sound levels, pan laws, etc... for various mix configurations. * Notes : (currently none) - * Authors: Olivier Lapicque - * OpenMPT Devs + * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ @@ -23,6 +22,7 @@ tempoModeClassic = 0, tempoModeAlternative = 1, tempoModeModern = 2, + tempoModeMax }; enum MixLevels @@ -33,6 +33,7 @@ mixLevels1_17RC3 = 3, mixLevelsCompatible = 4, mixLevelsCompatibleFT2 = 5, + mixLevelsMax }; enum ForcePanningMode Modified: trunk/OpenMPT/soundlib/pattern.cpp =================================================================== --- trunk/OpenMPT/soundlib/pattern.cpp 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/soundlib/pattern.cpp 2015-06-13 12:47:42 UTC (rev 5300) @@ -494,6 +494,10 @@ ssb.WriteItem<uint32>(pat.GetRowsPerBeat(), "RPB."); ssb.WriteItem<uint32>(pat.GetRowsPerMeasure(), "RPM."); } + if(pat.HasTempoSwing()) + { + ssb.WriteItem<TempoSwing>(pat.GetTempoSwing(), "SWNG", TempoSwing::Serialize); + } ssb.FinishWrite(); } @@ -511,6 +515,9 @@ ssb.ReadItem<uint32>(nRPB, "RPB."); ssb.ReadItem<uint32>(nRPM, "RPM."); pat.SetSignature(nRPB, nRPM); + TempoSwing swing; + ssb.ReadItem<TempoSwing>(swing, "SWNG", TempoSwing::Deserialize); + pat.SetTempoSwing(swing); } Modified: trunk/OpenMPT/soundlib/pattern.h =================================================================== --- trunk/OpenMPT/soundlib/pattern.h 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/soundlib/pattern.h 2015-06-13 12:47:42 UTC (rev 5300) @@ -92,6 +92,11 @@ bool SetSignature(const ROWINDEX rowsPerBeat, const ROWINDEX rowsPerMeasure); void RemoveSignature() { m_RowsPerBeat = m_RowsPerMeasure = 0; } + bool HasTempoSwing() const { return !m_tempoSwing.empty(); } + const TempoSwing& GetTempoSwing() const { return m_tempoSwing; } + void SetTempoSwing(const TempoSwing &swing) { m_tempoSwing = swing; m_tempoSwing.Normalize(); } + void RemoveTempoSwing() { m_tempoSwing.clear(); } + // Pattern name functions - bool functions return true on success. bool SetName(const std::string &newName); bool SetName(const char *newName, size_t maxChars = MAX_PATTERNNAME); @@ -151,6 +156,7 @@ ROWINDEX m_Rows; ROWINDEX m_RowsPerBeat; // patterns-specific time signature. if != 0, this is implicitely set. ROWINDEX m_RowsPerMeasure; // ditto + TempoSwing m_tempoSwing; std::string m_PatternName; CPatternContainer& m_rPatternContainer; //END: DATA Modified: trunk/OpenMPT/soundlib/patternContainer.cpp =================================================================== --- trunk/OpenMPT/soundlib/patternContainer.cpp 2015-06-13 12:42:43 UTC (rev 5299) +++ trunk/OpenMPT/soundlib/patternContainer.cpp 2015-06-13 12:47:42 UTC (rev 5300) @@ -147,6 +147,7 @@ for(PATTERNINDEX nPat = 0; nPat < m_Patterns.size(); nPat++) { m_Patterns[nPat].RemoveSignature(); + m_Patterns[nPat].RemoveTempoSwing(); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-06-13 14:18:11
|
Revision: 5305 http://sourceforge.net/p/modplug/code/5305 Author: manxorist Date: 2015-06-13 14:18:04 +0000 (Sat, 13 Jun 2015) Log Message: ----------- [Ref] mptString: Add mpt::CharsetLocaleOrUTF8 which does what it says. It is the same as CharsetLocale in tracker builds and in libopenmpt builds compiled without locale support. Otherwise it just assumes UTF8. This simplifies most cases that did check #if defined(MPT_WITH_CHARSET_LOCALE). [Ref] mptString: Kill mpt::ToLocale(str). mpt::ToCharset(mpt::CharsetLocale, str) did and does the same thing and it's used in only few places anyway. Modified Paths: -------------- trunk/OpenMPT/common/Logging.cpp trunk/OpenMPT/common/mptFileIO.h trunk/OpenMPT/common/mptPathString.h trunk/OpenMPT/common/mptString.cpp trunk/OpenMPT/common/mptString.h trunk/OpenMPT/common/mptStringFormat.cpp trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Settings.cpp trunk/OpenMPT/mptrack/Settings.h trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/view_com.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/test/test.cpp Modified: trunk/OpenMPT/common/Logging.cpp =================================================================== --- trunk/OpenMPT/common/Logging.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/common/Logging.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -101,11 +101,7 @@ std::clog << "openmpt: " << context.file << "(" << context.line << ")" << ": " -#if defined(MPT_WITH_CHARSET_LOCALE) - << mpt::ToLocale(message) -#else - << mpt::ToCharset(mpt::CharsetUTF8, message) -#endif + << mpt::ToCharset(mpt::CharsetLocaleOrUTF8, message) << " [" << context.function << "]" << std::endl; #endif // MODPLUG_TRACKER @@ -121,11 +117,7 @@ vsnprintf(message, LOGBUF_SIZE, format, va); message[LOGBUF_SIZE - 1] = '\0'; va_end(va); -#if defined(MPT_WITH_CHARSET_LOCALE) - DoLog(context, mpt::ToUnicode(mpt::CharsetLocale, message)); -#else - DoLog(context, mpt::ToUnicode(mpt::CharsetUTF8, message)); -#endif + DoLog(context, mpt::ToUnicode(mpt::CharsetLocaleOrUTF8, message)); } Modified: trunk/OpenMPT/common/mptFileIO.h =================================================================== --- trunk/OpenMPT/common/mptFileIO.h 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/common/mptFileIO.h 2015-06-13 14:18:04 UTC (rev 5305) @@ -94,8 +94,8 @@ template<typename Tbase> inline void fstream_open(Tbase & base, const mpt::PathString & filename, std::ios_base::openmode mode) { -#if defined( MPT_FSTREAM_DO_CONVERSIONS_ANSI) - base.open(mpt::ToLocale(filename.AsNative()).c_str(), mode); +#if defined(MPT_FSTREAM_DO_CONVERSIONS_ANSI) + base.open(mpt::ToCharset(mpt::CharsetLocale, filename.AsNative()).c_str(), mode); #else base.open(filename.AsNative().c_str(), mode); #endif Modified: trunk/OpenMPT/common/mptPathString.h =================================================================== --- trunk/OpenMPT/common/mptPathString.h 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/common/mptPathString.h 2015-06-13 14:18:04 UTC (rev 5305) @@ -157,7 +157,7 @@ #endif // conversions #if defined(MPT_WITH_CHARSET_LOCALE) - MPT_DEPRECATED_PATH std::string ToLocale() const { return mpt::ToLocale(path); } + MPT_DEPRECATED_PATH std::string ToLocale() const { return mpt::ToCharset(mpt::CharsetLocale, path); } #endif std::string ToUTF8() const { return mpt::ToCharset(mpt::CharsetUTF8, path); } std::wstring ToWide() const { return path; } @@ -230,7 +230,7 @@ }; #if defined(MPT_WITH_CHARSET_LOCALE) -MPT_DEPRECATED_PATH static inline std::string ToString(const mpt::PathString & x) { return mpt::ToLocale(x.ToUnicode()); } +MPT_DEPRECATED_PATH static inline std::string ToString(const mpt::PathString & x) { return mpt::ToCharset(mpt::CharsetLocale, x.ToUnicode()); } #endif #if MPT_WSTRING_FORMAT static inline std::wstring ToWString(const mpt::PathString & x) { return x.ToWide(); } Modified: trunk/OpenMPT/common/mptString.cpp =================================================================== --- trunk/OpenMPT/common/mptString.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/common/mptString.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -1403,7 +1403,7 @@ #ifdef UNICODE return str.c_str(); #else - return ToLocale(str).c_str(); + return ToCharset(CharsetLocale, str).c_str(); #endif } CString ToCString(Charset from, const std::string &str) @@ -1411,7 +1411,7 @@ #ifdef UNICODE return ToWide(from, str).c_str(); #else - return ToLocale(from, str).c_str(); + return ToCharset(CharsetLocale, from, str).c_str(); #endif } std::wstring ToWide(const CString &str) @@ -1460,7 +1460,7 @@ } CString ToCString(const CStringW &str) { - return ToLocale(str).c_str(); + return ToCharset(CharsetLocale, str).c_str(); } #endif // UNICODE Modified: trunk/OpenMPT/common/mptString.h =================================================================== --- trunk/OpenMPT/common/mptString.h 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/common/mptString.h 2015-06-13 14:18:04 UTC (rev 5305) @@ -153,9 +153,19 @@ CharsetCP437AMS2, CharsetWindows1252, + }; +// Locale in tracker builds, UTF8 in non-locale-aware libopenmpt builds. +#if defined(MPT_WITH_CHARSET_LOCALE) +const Charset CharsetLocaleOrUTF8 = CharsetLocale; +#else +const Charset CharsetLocaleOrUTF8 = CharsetUTF8; +#endif + + + // Checks if the std::string represents an UTF8 string. // This is currently implemented as converting to std::wstring and back assuming UTF8 both ways, // and comparing the result to the original string. @@ -268,20 +278,6 @@ #endif // MFC -#if defined(MPT_WITH_CHARSET_LOCALE) -// Convert to locale-encoded string. -// On Windows, CP_ACP is used, -// otherwise, the global C locale is used. -// If str does not contain any invalid characters, -// this conversion will be lossless iff, and only iff, the system is NOT -// windows AND a UTF8 locale is set. -// Invalid source bytes or characters that are not representable in the -// destination charset will be replaced by some replacement character or string. -template <typename Tsrc> inline std::string ToLocale(const Tsrc &str) { return ToCharset(CharsetLocale, str); } -static inline std::string ToLocale(Charset from, const std::string &str) { return ToCharset(CharsetLocale, from, str); } -#endif - - // mpt::ustring // // mpt::ustring is a string type that can hold unicode strings. Modified: trunk/OpenMPT/common/mptStringFormat.cpp =================================================================== --- trunk/OpenMPT/common/mptStringFormat.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/common/mptStringFormat.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -51,30 +51,16 @@ #endif #if MPT_WSTRING_CONVERT -#if defined(MPT_WITH_CHARSET_LOCALE) -std::string ToString(const std::wstring & x) { return mpt::ToLocale(x); } -std::string ToString(const wchar_t * const & x) { return mpt::ToLocale(x); } -std::string ToString(const wchar_t & x) { return mpt::ToLocale(std::wstring(1, x)); } -#else -std::string ToString(const std::wstring & x) { return mpt::ToCharset(mpt::CharsetUTF8, x); } -std::string ToString(const wchar_t * const & x) { return mpt::ToCharset(mpt::CharsetUTF8, x); } -std::string ToString(const wchar_t & x) { return mpt::ToCharset(mpt::CharsetUTF8, std::wstring(1, x)); } +std::string ToString(const std::wstring & x) { return mpt::ToCharset(mpt::CharsetLocaleOrUTF8, x); } +std::string ToString(const wchar_t * const & x) { return mpt::ToCharset(mpt::CharsetLocaleOrUTF8, x); } +std::string ToString(const wchar_t & x) { return mpt::ToCharset(mpt::CharsetLocaleOrUTF8, std::wstring(1, x)); } #endif -#endif #if MPT_USTRING_MODE_UTF8 -#if defined(MPT_WITH_CHARSET_LOCALE) -std::string ToString(const mpt::ustring & x) { return mpt::ToLocale(x); } -#else -std::string ToString(const mpt::ustring & x) { return mpt::ToCharset(mpt::CharsetUTF8, x); } +std::string ToString(const mpt::ustring & x) { return mpt::ToCharset(mpt::CharsetLocaleOrUTF8, x); } #endif -#endif #if defined(_MFC_VER) -#if defined(MPT_WITH_CHARSET_LOCALE) -std::string ToString(const CString & x) { return mpt::ToLocale(x); } -#else -std::string ToString(const CString & x) { return mpt::ToCharset(mpt::CharsetUTF8, x); } +std::string ToString(const CString & x) { return mpt::ToCharset(mpt::CharsetLocaleOrUTF8, x); } #endif -#endif std::string ToString(const bool & x) { return ToStringHelper(x); } std::string ToString(const signed char & x) { return ToStringHelper(x); } std::string ToString(const unsigned char & x) { return ToStringHelper(x); } @@ -91,15 +77,9 @@ std::string ToString(const long double & x) { return ToStringHelper(x); } #if MPT_WSTRING_FORMAT -#if defined(MPT_WITH_CHARSET_LOCALE) -std::wstring ToWString(const std::string & x) { return mpt::ToWide(mpt::CharsetLocale, x); } -std::wstring ToWString(const char * const & x) { return mpt::ToWide(mpt::CharsetLocale, x); } -std::wstring ToWString(const char & x) { return mpt::ToWide(mpt::CharsetLocale, std::string(1, x)); } -#else -std::wstring ToWString(const std::string & x) { return mpt::ToWide(mpt::CharsetUTF8, x); } -std::wstring ToWString(const char * const & x) { return mpt::ToWide(mpt::CharsetUTF8, x); } -std::wstring ToWString(const char & x) { return mpt::ToWide(mpt::CharsetUTF8, std::string(1, x)); } -#endif +std::wstring ToWString(const std::string & x) { return mpt::ToWide(mpt::CharsetLocaleOrUTF8, x); } +std::wstring ToWString(const char * const & x) { return mpt::ToWide(mpt::CharsetLocaleOrUTF8, x); } +std::wstring ToWString(const char & x) { return mpt::ToWide(mpt::CharsetLocaleOrUTF8, std::string(1, x)); } #if MPT_USTRING_MODE_UTF8 std::wstring ToWString(const mpt::ustring & x) { return mpt::ToWide(x); } #endif Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -452,7 +452,7 @@ if(strcmp(m_VstPlugin.m_pMixStruct->GetName(), "")) Title.Append(m_VstPlugin.m_pMixStruct->GetName()); else - Title.Append(mpt::ToLocale(mpt::CharsetUTF8, m_VstPlugin.m_pMixStruct->GetLibraryName()).c_str()); + Title.Append(mpt::ToCharset(mpt::CharsetLocale, mpt::CharsetUTF8, m_VstPlugin.m_pMixStruct->GetLibraryName()).c_str()); if(m_VstPlugin.isBridged) Title.Append(" (Bridged)"); @@ -952,7 +952,7 @@ m_nInstrument = nIns; _snprintf(pIns->name, CountOf(pIns->name) - 1, _T("%d: %s"), m_VstPlugin.GetSlot() + 1, sndFile.m_MixPlugins[m_VstPlugin.GetSlot()].GetName()); - mpt::String::Copy(pIns->filename, mpt::ToLocale(mpt::CharsetUTF8, sndFile.m_MixPlugins[m_VstPlugin.GetSlot()].GetLibraryName())); + mpt::String::Copy(pIns->filename, mpt::ToCharset(mpt::CharsetLocale, mpt::CharsetUTF8, sndFile.m_MixPlugins[m_VstPlugin.GetSlot()].GetLibraryName())); pIns->nMixPlug = (PLUGINDEX)m_VstPlugin.GetSlot() + 1; pIns->nMidiChannel = 1; // People will forget to change this anyway, so the following lines can lead to some bad surprises after re-opening the module. Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -1281,7 +1281,7 @@ if ((n < 0) || (n >= 4)) n = 0; CString s; GetDlgItemText(IDC_EDIT1, s); - mpt::String::Copy(m_EQ.szName, mpt::ToLocale(s)); + mpt::String::Copy(m_EQ.szName, mpt::ToCharset(mpt::CharsetLocale, s)); mpt::String::SetNullTerminator(m_EQ.szName); TrackerSettings::Instance().m_EqUserPresets[n] = m_EQ; } Modified: trunk/OpenMPT/mptrack/Settings.cpp =================================================================== --- trunk/OpenMPT/mptrack/Settings.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/mptrack/Settings.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -341,7 +341,7 @@ { ::WritePrivateProfileStringW(GetSection(path).c_str(), GetKey(path).c_str(), val.c_str(), filename.AsNative().c_str()); - if(mpt::ToWide(mpt::CharsetLocale, mpt::ToLocale(val)) != val) // explicit round-trip + if(mpt::ToWide(mpt::CharsetLocale, mpt::ToCharset(mpt::CharsetLocale, val)) != val) // explicit round-trip { // Value is not representable in ANSI CP. // Now check if the string got stored correctly. Modified: trunk/OpenMPT/mptrack/Settings.h =================================================================== --- trunk/OpenMPT/mptrack/Settings.h 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/mptrack/Settings.h 2015-06-13 14:18:04 UTC (rev 5305) @@ -255,7 +255,7 @@ operator std::string () const { ASSERT(type == SettingTypeString); - return mpt::ToLocale(valueString); + return mpt::ToCharset(mpt::CharsetLocale, valueString); } operator std::wstring () const { Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -1556,7 +1556,7 @@ return enSclImportAddTuningFailure; } - pT->SetName(mpt::ToLocale(name)); + pT->SetName(mpt::ToCharset(mpt::CharsetLocale, name)); return enSclImportOk; } Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -515,7 +515,7 @@ const SNDMIXPLUGIN &plugin = sndFile.m_MixPlugins[iOut]; if(plugin.IsValidPlugin()) { - std::string libName = mpt::ToLocale(mpt::CharsetUTF8, plugin.GetLibraryName()); + std::string libName = mpt::ToCharset(mpt::CharsetLocale, mpt::CharsetUTF8, plugin.GetLibraryName()); if(!strcmp(plugin.GetName(), "") || libName != plugin.GetName()) { wsprintf(s, "FX%d: %s", iOut + 1, libName.c_str()); Modified: trunk/OpenMPT/mptrack/view_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/view_com.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/mptrack/view_com.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -388,7 +388,7 @@ case INSLIST_PLUGIN: if (pIns != nullptr && pIns->nMixPlug > 0 && sndFile.m_MixPlugins[pIns->nMixPlug - 1].pMixPlugin != nullptr) { - wsprintf(s, "FX%02u: %s", pIns->nMixPlug, mpt::ToLocale(mpt::CharsetUTF8, sndFile.m_MixPlugins[pIns->nMixPlug - 1].GetLibraryName()).c_str()); + wsprintf(s, "FX%02u: %s", pIns->nMixPlug, mpt::ToCharset(mpt::CharsetLocale, mpt::CharsetUTF8, sndFile.m_MixPlugins[pIns->nMixPlug - 1].GetLibraryName()).c_str()); } break; } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -322,7 +322,7 @@ // Read archive comment if there is no song comment if(songMessage.empty()) { - songMessage.assign(mpt::ToLocale(unarchiver.GetComment())); + songMessage.assign(mpt::ToCharset(mpt::CharsetLocale, unarchiver.GetComment())); } #endif Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/soundlib/Sndfile.h 2015-06-13 14:18:04 UTC (rev 5305) @@ -566,11 +566,7 @@ // logging and user interaction void SetCustomLog(ILog *pLog) { m_pCustomLog = pLog; } void AddToLog(LogLevel level, const mpt::ustring &text) const; -#if defined(MPT_WITH_CHARSET_LOCALE) - /*MPT_DEPRECATED*/ void AddToLog(const std::string &text) const { AddToLog(LogInformation, mpt::ToUnicode(mpt::CharsetLocale, text)); } -#else - /*MPT_DEPRECATED*/ void AddToLog(const std::string &text) const { AddToLog(LogInformation, mpt::ToUnicode(mpt::CharsetUTF8, text)); } -#endif + /*MPT_DEPRECATED*/ void AddToLog(const std::string &text) const { AddToLog(LogInformation, mpt::ToUnicode(mpt::CharsetLocaleOrUTF8, text)); } public: Modified: trunk/OpenMPT/test/test.cpp =================================================================== --- trunk/OpenMPT/test/test.cpp 2015-06-13 13:54:16 UTC (rev 5304) +++ trunk/OpenMPT/test/test.cpp 2015-06-13 14:18:04 UTC (rev 5305) @@ -700,7 +700,7 @@ VERIFY_EQUAL(mpt::ToUnicode(mpt::CharsetISO8859_1, "a"), MPT_USTRING("a")); VERIFY_EQUAL(mpt::ToUnicode(mpt::CharsetASCII, "a"), MPT_USTRING("a")); #if defined(MPT_WITH_CHARSET_LOCALE) - VERIFY_EQUAL(mpt::ToLocale(MPT_USTRING("a")), "a"); + VERIFY_EQUAL(mpt::ToCharset(mpt::CharsetLocale, MPT_USTRING("a")), "a"); VERIFY_EQUAL(mpt::ToUnicode(mpt::CharsetLocale, "a"), MPT_USTRING("a")); #endif VERIFY_EQUAL(mpt::ToCharset(mpt::CharsetUTF8, MPT_UTF8("a")), "a"); @@ -710,7 +710,7 @@ VERIFY_EQUAL(mpt::ToUnicode(mpt::CharsetISO8859_1, "a"), MPT_UTF8("a")); VERIFY_EQUAL(mpt::ToUnicode(mpt::CharsetASCII, "a"), MPT_UTF8("a")); #if defined(MPT_WITH_CHARSET_LOCALE) - VERIFY_EQUAL(mpt::ToLocale(MPT_UTF8("a")), "a"); + VERIFY_EQUAL(mpt::ToCharset(mpt::CharsetLocale, MPT_UTF8("a")), "a"); VERIFY_EQUAL(mpt::ToUnicode(mpt::CharsetLocale, "a"), MPT_UTF8("a")); #endif @@ -799,7 +799,7 @@ VERIFY_EQUAL(mpt::ToWide(mpt::CharsetISO8859_1, "a"), L"a"); VERIFY_EQUAL(mpt::ToWide(mpt::CharsetASCII, "a"), L"a"); #if defined(MPT_WITH_CHARSET_LOCALE) - VERIFY_EQUAL(mpt::ToLocale(L"a"), "a"); + VERIFY_EQUAL(mpt::ToCharset(mpt::CharsetLocale, L"a"), "a"); VERIFY_EQUAL(mpt::ToWide(mpt::CharsetLocale, "a"), L"a"); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-13 16:10:37
|
Revision: 5310 http://sourceforge.net/p/modplug/code/5310 Author: saga-games Date: 2015-06-13 16:10:31 +0000 (Sat, 13 Jun 2015) Log Message: ----------- [Fix] Export: Enabling instrument or channel mode and then enabling render to sample enabled the sample dropdown list. [Fix] Render To Sample: Fix possible crash when updating instrument mute states after rendering by instrument [Imp] Render To Sample: Create some usable sample names. [Ref] Silence unused variable warning in plugin bridge Modified Paths: -------------- trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/pluginBridge/Bridge.cpp trunk/OpenMPT/pluginBridge/Bridge.h Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2015-06-13 15:45:54 UTC (rev 5309) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2015-06-13 16:10:31 UTC (rev 5310) @@ -589,7 +589,7 @@ bSel = (IsDlgButtonChecked(IDC_RADIO4) != BST_UNCHECKED) ? FALSE : TRUE; m_CbnFileType.EnableWindow(bSel); - m_CbnSampleSlot.EnableWindow(!bSel); + m_CbnSampleSlot.EnableWindow(!bSel && !IsDlgButtonChecked(IDC_CHECK4) && !IsDlgButtonChecked(IDC_CHECK6)); if(!bSel) { // Render to sample: Always use WAV @@ -670,11 +670,8 @@ { CheckDlgButton(IDC_CHECK6, BST_UNCHECKED); m_CbnSampleSlot.SetCurSel(0); - m_CbnSampleSlot.EnableWindow(FALSE); - } else - { - m_CbnSampleSlot.EnableWindow(IsDlgButtonChecked(IDC_RADIO4)); } + UpdateDialog(); } @@ -686,11 +683,8 @@ { CheckDlgButton(IDC_CHECK4, BST_UNCHECKED); m_CbnSampleSlot.SetCurSel(0); - m_CbnSampleSlot.EnableWindow(FALSE); - } else - { - m_CbnSampleSlot.EnableWindow(IsDlgButtonChecked(IDC_RADIO4)); } + UpdateDialog(); } Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2015-06-13 15:45:54 UTC (rev 5309) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2015-06-13 16:10:31 UTC (rev 5310) @@ -1840,9 +1840,12 @@ } if(!cancel) { + if(GetNumSamples() < smp) m_SndFile.m_nSamples = smp; GetSampleUndo().PrepareUndo(smp, sundo_replace, "Render To Sample"); if(m_SndFile.ReadSampleFromFile(smp, file, false)) { + strcpy(m_SndFile.m_szNames[smp], "Render To Sample"); + strncat(m_SndFile.m_szNames[smp], fileNameAdd, MAX_SAMPLENAME - strlen("Render To Sample") - 1); UpdateAllViews(nullptr, SampleHint().Info().Data().Names()); if(m_SndFile.GetNumInstruments()) { @@ -1884,18 +1887,12 @@ // Restore instruments' / samples' flags if(wsdlg.m_bInstrumentMode) { - if(m_SndFile.GetNumInstruments() == 0) + for(size_t i = 0; i < instrMuteState.size(); i++) { - for(SAMPLEINDEX i = 0; i < m_SndFile.GetNumSamples(); i++) - { - MuteSample(i + 1, instrMuteState[i]); - } - } else - { - for(INSTRUMENTINDEX i = 0; i < m_SndFile.GetNumInstruments(); i++) - { - MuteInstrument(i + 1, instrMuteState[i]); - } + if(m_SndFile.GetNumInstruments() == 0) + MuteSample(static_cast<SAMPLEINDEX>(i + 1), instrMuteState[i]); + else + MuteInstrument(static_cast<INSTRUMENTINDEX>(i + 1), instrMuteState[i]); } } Modified: trunk/OpenMPT/pluginBridge/Bridge.cpp =================================================================== --- trunk/OpenMPT/pluginBridge/Bridge.cpp 2015-06-13 15:45:54 UTC (rev 5309) +++ trunk/OpenMPT/pluginBridge/Bridge.cpp 2015-06-13 16:10:31 UTC (rev 5310) @@ -206,9 +206,10 @@ } if(window) { - MessageHandler(); + Dispatch(effEditIdle, 0, 0, nullptr, 0.0f); } - // 4klang VSTi creates its custom window in the message thread, and it will freeze if we don't dispatch messages here... + // Normally we would only need this block if there's an editor window, but the 4klang VSTi creates + // its custom window in the message thread, and it will freeze if we don't dispatch messages here... MSG msg; while(::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { @@ -687,12 +688,9 @@ case effGetChunk: // void** in [ptr] for chunk data address + if(getChunkMem.Create(static_cast<const wchar_t *>(origPtr), msg->result)) { - void *chunkPtr = *reinterpret_cast<void **>(&extraData[0]); - if(getChunkMem.Create(static_cast<const wchar_t *>(origPtr), msg->result)) - { - memcpy(getChunkMem.view, *reinterpret_cast<void **>(&extraData[0]), msg->result); - } + memcpy(getChunkMem.view, *reinterpret_cast<void **>(&extraData[0]), msg->result); } break; } @@ -1173,18 +1171,4 @@ } -// WinAPI message handler for plugin GUI -void PluginBridge::MessageHandler() -{ - Dispatch(effEditIdle, 0, 0, nullptr, 0.0f); - - MSG msg; - while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } -} - - OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/pluginBridge/Bridge.h =================================================================== --- trunk/OpenMPT/pluginBridge/Bridge.h 2015-06-13 15:45:54 UTC (rev 5309) +++ trunk/OpenMPT/pluginBridge/Bridge.h 2015-06-13 16:10:31 UTC (rev 5310) @@ -81,7 +81,6 @@ void RenderThread(); static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); - void MessageHandler(); static VstIntPtr VSTCALLBACK MasterCallback(AEffect *effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void *ptr, float opt); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-06-13 16:51:51
|
Revision: 5312 http://sourceforge.net/p/modplug/code/5312 Author: manxorist Date: 2015-06-13 16:51:44 +0000 (Sat, 13 Jun 2015) Log Message: ----------- [Ref] Add MPT_ASSERT_NOTREACHED(). Modified Paths: -------------- trunk/OpenMPT/common/mptIO.h trunk/OpenMPT/common/mptString.cpp trunk/OpenMPT/common/mptTime.cpp trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp trunk/OpenMPT/soundlib/ITCompression.cpp trunk/OpenMPT/soundlib/Load_okt.cpp trunk/OpenMPT/soundlib/Load_umx.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/WAVTools.cpp trunk/OpenMPT/soundlib/tuning.cpp Modified: trunk/OpenMPT/common/mptIO.h =================================================================== --- trunk/OpenMPT/common/mptIO.h 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/common/mptIO.h 2015-06-13 16:51:44 UTC (rev 5312) @@ -298,7 +298,7 @@ return IO::WriteIntLE<uint16>(f, static_cast<uint16>(v << 1) | 0x01); } else { - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); return false; } } @@ -328,7 +328,7 @@ return IO::WriteIntLE<uint32>(f, static_cast<uint32>(v << 2) | 0x03); } else { - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); return false; } } @@ -353,7 +353,7 @@ return IO::WriteIntLE<uint64>(f, static_cast<uint64>(v << 2) | 0x03); } else { - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); return false; } } Modified: trunk/OpenMPT/common/mptString.cpp =================================================================== --- trunk/OpenMPT/common/mptString.cpp 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/common/mptString.cpp 2015-06-13 16:51:44 UTC (rev 5312) @@ -684,7 +684,7 @@ { // nothing } - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); return String::FromAscii(str, replacement); // fallback } @@ -715,7 +715,7 @@ { // nothing } - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); return String::ToAscii(str, replacement); // fallback } Modified: trunk/OpenMPT/common/mptTime.cpp =================================================================== --- trunk/OpenMPT/common/mptTime.cpp 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/common/mptTime.cpp 2015-06-13 16:51:44 UTC (rev 5312) @@ -227,7 +227,7 @@ if(timeEndPeriod(m_CurrentPeriod) != MMSYSERR_NOERROR) { // should not happen - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); } m_CurrentPeriod = 0; } Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/common/typedefs.h 2015-06-13 16:51:44 UTC (rev 5312) @@ -325,6 +325,7 @@ #if defined(MPT_FRAMEWORK_ASSERT_IS_DEFINED) && (MPT_ASSERT_USE_FRAMEWORK == 1) +#define MPT_ASSERT_NOTREACHED() ASSERT(0) #define MPT_ASSERT(expr) ASSERT((expr)) #define MPT_ASSERT_MSG(expr, msg) ASSERT((expr) && (msg)) #if (MPT_FRAMEWORK_ASSERT_IS_ACTIVE == 1) @@ -340,6 +341,7 @@ #elif defined(NO_ASSERTS) +#define MPT_ASSERT_NOTREACHED() MPT_CHECKER_ASSUME(0) #define MPT_ASSERT(expr) MPT_CHECKER_ASSUME(expr) #define MPT_ASSERT_MSG(expr, msg) MPT_CHECKER_ASSUME(expr) #define MPT_ASSERT_ALWAYS(expr) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 @@ -350,6 +352,7 @@ #else // !NO_ASSERTS +#define MPT_ASSERT_NOTREACHED() MPT_DO { MPT_CONSTANT_IF(!(0)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, "0"); } MPT_CHECKER_ASSUME(0); } MPT_WHILE_0 #define MPT_ASSERT(expr) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 #define MPT_ASSERT_MSG(expr, msg) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr, msg); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 #define MPT_ASSERT_ALWAYS(expr) MPT_DO { if(!(expr)) { AssertHandler(__FILE__, __LINE__, __FUNCTION__, #expr); } MPT_CHECKER_ASSUME(expr); } MPT_WHILE_0 Modified: trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/sounddev/SoundDeviceASIO.cpp 2015-06-13 16:51:44 UTC (rev 5312) @@ -375,7 +375,7 @@ } } else { // should not happen - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); } m_BufferInfo.resize(m_Settings.GetTotalChannels()); @@ -932,7 +932,7 @@ CopyChannelToInterleaved<SC::Convert<float, double> >(dstFloat, reinterpret_cast<double*>(src), inputChannels, countChunk, inputChannel); break; default: - ASSERT(false); + MPT_ASSERT_NOTREACHED(); break; } } else if(m_Settings.sampleFormat == SampleFormatInt16) @@ -952,7 +952,7 @@ CopyChannelToInterleaved<SC::Convert<int16, int16> >(dstInt16, reinterpret_cast<int16*>(src), inputChannels, countChunk, inputChannel); break; default: - ASSERT(false); + MPT_ASSERT_NOTREACHED(); break; } } else if(m_Settings.sampleFormat == SampleFormatInt24) @@ -972,7 +972,7 @@ CopyChannelToInterleaved<SC::Convert<int24, int24> >(dstInt24, reinterpret_cast<int24*>(src), inputChannels, countChunk, inputChannel); break; default: - ASSERT(false); + MPT_ASSERT_NOTREACHED(); break; } } else if(m_Settings.sampleFormat == SampleFormatInt32) @@ -1024,12 +1024,12 @@ CopyChannelToInterleaved<SC::ConvertShiftUp<int32, int32, 8> >(dstInt32, reinterpret_cast<int32*>(src), inputChannels, countChunk, inputChannel); break; default: - ASSERT(false); + MPT_ASSERT_NOTREACHED(); break; } } else { - ASSERT(false); + MPT_ASSERT_NOTREACHED(); } } if(rendersilence) @@ -1048,7 +1048,7 @@ std::memset(&m_SampleBufferInt32[0], 0, countChunk * outputChannels * sizeof(int32)); } else { - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); } } else { @@ -1067,7 +1067,7 @@ SourceAudioRead(&m_SampleBufferInt32[0], (m_SampleInputBufferInt32.size() > 0) ? &m_SampleInputBufferInt32[0] : nullptr, countChunk); } else { - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); } } for(std::size_t outputChannel = 0; outputChannel < outputChannels; ++outputChannel) @@ -1093,7 +1093,7 @@ CopyInterleavedToChannel<SC::Convert<double, float> >(reinterpret_cast<double*>(dst), srcFloat, outputChannels, countChunk, outputChannel); break; default: - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); break; } } else if(m_Settings.sampleFormat == SampleFormatInt16) @@ -1106,7 +1106,7 @@ CopyInterleavedToChannel<SC::Convert<int16, int16> >(reinterpret_cast<int16*>(dst), srcInt16, outputChannels, countChunk, outputChannel); break; default: - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); break; } } else if(m_Settings.sampleFormat == SampleFormatInt24) @@ -1119,7 +1119,7 @@ CopyInterleavedToChannel<SC::Convert<int24, int24> >(reinterpret_cast<int24*>(dst), srcInt24, outputChannels, countChunk, outputChannel); break; default: - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); break; } } else if(m_Settings.sampleFormat == SampleFormatInt32) @@ -1164,12 +1164,12 @@ CopyInterleavedToChannel<SC::ConvertShift<int32, int32, 8> >(reinterpret_cast<int32*>(dst), srcInt32, outputChannels, countChunk, outputChannel); break; default: - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); break; } } else { - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); } if(IsSampleTypeBigEndian(m_ChannelInfo[channel].type)) { Modified: trunk/OpenMPT/soundlib/ITCompression.cpp =================================================================== --- trunk/OpenMPT/soundlib/ITCompression.cpp 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/soundlib/ITCompression.cpp 2015-06-13 16:51:44 UTC (rev 5312) @@ -305,7 +305,7 @@ } else { // How could this happen, anyway? - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); } } Modified: trunk/OpenMPT/soundlib/Load_okt.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_okt.cpp 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/soundlib/Load_okt.cpp 2015-06-13 16:51:44 UTC (rev 5312) @@ -274,7 +274,7 @@ default: m->command = m->param = 0; - //MPT_ASSERT(false); + //MPT_ASSERT_NOTREACHED(); break; } } Modified: trunk/OpenMPT/soundlib/Load_umx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_umx.cpp 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/soundlib/Load_umx.cpp 2015-06-13 16:51:44 UTC (rev 5312) @@ -273,7 +273,7 @@ // Can't bother to implement property reading, as no UMX files I've seen so far use properties for the relevant objects, // and only the UAX files in the Unreal 1997/98 beta seem to use this and still load just fine when ignoring it. // If it should be necessary to implement this, check CUnProperty.cpp in http://ut-files.com/index.php?dir=Utilities/&file=utcms_source.zip - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); continue; } #else Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2015-06-13 16:51:44 UTC (rev 5312) @@ -2431,7 +2431,7 @@ SampleToFLAC32(sampleData, sample.pSample16, numSamples); } else { - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); } // Do the actual conversion. Modified: trunk/OpenMPT/soundlib/WAVTools.cpp =================================================================== --- trunk/OpenMPT/soundlib/WAVTools.cpp 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/soundlib/WAVTools.cpp 2015-06-13 16:51:44 UTC (rev 5312) @@ -400,7 +400,7 @@ } else { // Should never happen - did we calculate a wrong memory size? - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); } } position += numBytes; Modified: trunk/OpenMPT/soundlib/tuning.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuning.cpp 2015-06-13 16:44:01 UTC (rev 5311) +++ trunk/OpenMPT/soundlib/tuning.cpp 2015-06-13 16:51:44 UTC (rev 5312) @@ -261,7 +261,7 @@ if(GetType() == TT_GROUPGEOMETRIC) return m_RatioTableFine[GetRefNote(note) * GetFineStepCount() + sd - 1]; - MPT_ASSERT(false); + MPT_ASSERT_NOTREACHED(); return m_RatioTableFine[0]; //Shouldn't happen. } else //Calculating ratio 'on the fly'. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-06-13 19:59:00
|
Revision: 5314 http://sourceforge.net/p/modplug/code/5314 Author: saga-games Date: 2015-06-13 19:58:53 +0000 (Sat, 13 Jun 2015) Log Message: ----------- [Fix] Support for tempo swing in pattern copy&paste, pattern cleanup, etc Modified Paths: -------------- trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/PatternClipboard.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/soundlib/Snd_defs.h Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2015-06-13 17:17:54 UTC (rev 5313) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2015-06-13 19:58:53 UTC (rev 5314) @@ -372,6 +372,7 @@ { // This stuff is needed for copying the old pattern properties to the new pattern number std::string name; // original pattern name + TempoSwing swing; // original pattern tempo swing ModCommand *data; // original pattern data ROWINDEX numRows; // original pattern sizes ROWINDEX rowsPerBeat; // original pattern highlight @@ -380,7 +381,7 @@ PATTERNINDEX newIndex; // map old pattern index <-> new pattern index }; -const OrigPatSettings defaultSettings = { "", nullptr, 0, 0, 0, PATTERNINDEX_INVALID }; +const OrigPatSettings defaultSettings = { "", TempoSwing(), nullptr, 0, 0, 0, PATTERNINDEX_INVALID }; // Rearrange patterns (first pattern in order list = 0, etc...) @@ -437,6 +438,7 @@ patternSettings[newIndex].rowsPerBeat = sndFile.Patterns[pat].GetRowsPerBeat(); patternSettings[newIndex].rowsPerMeasure = sndFile.Patterns[pat].GetRowsPerMeasure(); } + patternSettings[newIndex].swing = sndFile.Patterns[pat].GetTempoSwing(); patternSettings[newIndex].name = sndFile.Patterns[pat].GetName(); } } @@ -446,6 +448,7 @@ { sndFile.Patterns[pat].SetData(patternSettings[pat].data, patternSettings[pat].numRows); sndFile.Patterns[pat].SetSignature(patternSettings[pat].rowsPerBeat, patternSettings[pat].rowsPerMeasure); + sndFile.Patterns[pat].SetTempoSwing(patternSettings[pat].swing); sndFile.Patterns[pat].SetName(patternSettings[pat].name); } Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2015-06-13 17:17:54 UTC (rev 5313) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2015-06-13 19:58:53 UTC (rev 5314) @@ -828,9 +828,12 @@ if(m_sndFile.Patterns.IsValidPat(newPat)) { // update time signature - if(m_sndFile.Patterns.IsValidIndex(curPat) && m_sndFile.Patterns[curPat].GetOverrideSignature()) + if(m_sndFile.Patterns.IsValidIndex(curPat)) { - m_sndFile.Patterns[newPat].SetSignature(m_sndFile.Patterns[curPat].GetRowsPerBeat(), m_sndFile.Patterns[curPat].GetRowsPerMeasure()); + if(m_sndFile.Patterns[curPat].GetOverrideSignature()) + m_sndFile.Patterns[newPat].SetSignature(m_sndFile.Patterns[curPat].GetRowsPerBeat(), m_sndFile.Patterns[curPat].GetRowsPerMeasure()); + if(m_sndFile.Patterns[curPat].HasTempoSwing()) + m_sndFile.Patterns[newPat].SetTempoSwing(m_sndFile.Patterns[curPat].GetTempoSwing()); } // move to new pattern m_OrderList.SetCurSel(curOrd); Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2015-06-13 17:17:54 UTC (rev 5313) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2015-06-13 19:58:53 UTC (rev 5314) @@ -656,6 +656,9 @@ if(nNewRPB <= pSndFile->Patterns[nPat].GetRowsPerMeasure()) { pSndFile->Patterns[nPat].SetSignature(nNewRPB, pSndFile->Patterns[nPat].GetRowsPerMeasure()); + TempoSwing swing = pSndFile->Patterns[nPat].GetTempoSwing(); + swing.resize(nNewRPB); + pSndFile->Patterns[nPat].SetTempoSwing(swing); pModDoc->SetModified(); } } else Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2015-06-13 17:17:54 UTC (rev 5313) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2015-06-13 19:58:53 UTC (rev 5314) @@ -1847,7 +1847,7 @@ strcpy(m_SndFile.m_szNames[smp], "Render To Sample"); strncat(m_SndFile.m_szNames[smp], fileNameAdd, MAX_SAMPLENAME - strlen("Render To Sample") - 1); UpdateAllViews(nullptr, SampleHint().Info().Data().Names()); - if(m_SndFile.GetNumInstruments()) + if(m_SndFile.GetNumInstruments() && !m_SndFile.IsSampleUsed(smp)) { InsertInstrument(smp); UpdateAllViews(nullptr, InstrumentHint().Info().Names()); Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2015-06-13 17:17:54 UTC (rev 5313) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2015-06-13 19:58:53 UTC (rev 5314) @@ -823,10 +823,10 @@ // Set current directory to My Documents (normal) or OpenMPT directory (portable). // If no sample / mod / etc. paths are set up by the user, this will be the default location for browsing files. - if(portableMode) + if(portableMode || SHGetFolderPathW(NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, dir) != S_OK) { SetCurrentDirectoryW(configPathApp.AsNative().c_str()); - } else if(SHGetFolderPathW(NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, dir) == S_OK) + } else { SetCurrentDirectoryW(dir); } @@ -1057,8 +1057,8 @@ // Initialize CMainFrame pMainFrame->Initialize(); InitCommonControls(); - m_dwLastPluginIdleCall = 0; //rewbs.VSTCompliance - pMainFrame->m_InputHandler->UpdateMainMenu(); //rewbs.customKeys + m_dwLastPluginIdleCall = 0; + pMainFrame->m_InputHandler->UpdateMainMenu(); // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) Modified: trunk/OpenMPT/mptrack/PatternClipboard.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternClipboard.cpp 2015-06-13 17:17:54 UTC (rev 5313) +++ trunk/OpenMPT/mptrack/PatternClipboard.cpp 2015-06-13 19:58:53 UTC (rev 5314) @@ -32,6 +32,7 @@ * 'Rows: 64\r\n' (must be first) * 'Name: Pattern Name\r\n' (optional) * 'Signature: 4/16\r\n' (optional) + * 'Swing: 16777216,16777216,16777216,16777216\r\n' (optional) * Pattern data... */ @@ -94,16 +95,27 @@ // New pattern patList[pattern] = insertedPats++; - patternData.AppendFormat("Rows: %u\r\n", sndFile.Patterns[pattern].GetNumRows()); - CStringA name = sndFile.Patterns[pattern].GetName().c_str(); + const CPattern &pat = sndFile.Patterns[pattern]; + patternData.AppendFormat("Rows: %u\r\n", pat.GetNumRows()); + CStringA name = pat.GetName().c_str(); if(!name.IsEmpty()) { patternData.Append("Name: " + name + "\r\n"); } - if(sndFile.Patterns[pattern].GetOverrideSignature()) + if(pat.GetOverrideSignature()) { - patternData.AppendFormat("Signature: %u/%u\r\n", sndFile.Patterns[pattern].GetRowsPerBeat(), sndFile.Patterns[pattern].GetRowsPerMeasure()); + patternData.AppendFormat("Signature: %u/%u\r\n", pat.GetRowsPerBeat(), pat.GetRowsPerMeasure()); } + if(pat.HasTempoSwing()) + { + patternData += "Swing: "; + const TempoSwing &swing = pat.GetTempoSwing(); + for(size_t i = 0; i < swing.size(); i++) + { + patternData.AppendFormat(i == 0 ? "%u" : ",%u", swing[i]); + } + patternData += "\r\n"; + } patternData.Append(CreateClipboardString(sndFile, pattern, PatternRect(PatternCursor(), PatternCursor(sndFile.Patterns[pattern].GetNumRows() - 1, sndFile.GetNumChannels() - 1, PatternCursor::lastColumn)))); } @@ -527,6 +539,18 @@ ROWINDEX rpb = ConvertStrTo<ROWINDEX>(data.Mid(pos, pos2 - pos)); ROWINDEX rpm = ConvertStrTo<ROWINDEX>(data.Mid(pos2, eol - pos2)); sndFile.Patterns[pattern].SetSignature(rpb, rpm); + } else if(data.Mid(pos, 7) == "Swing: ") + { + pos += 7; + TempoSwing swing; + swing.resize(sndFile.Patterns[pattern].GetRowsPerBeat(), TempoSwing::Unity); + size_t i = 0; + while(pos > 0 && pos < eol && i < swing.size()) + { + swing[i++] = ConvertStrTo<TempoSwing::value_type>(data.Mid(pos, eol - pos)); + pos = data.Find(",", pos + 1) + 1; + } + sndFile.Patterns[pattern].SetTempoSwing(swing); } else { break; Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-06-13 17:17:54 UTC (rev 5313) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-06-13 19:58:53 UTC (rev 5314) @@ -366,8 +366,7 @@ if(sndFile.m_nTempoMode == tempoModeModern) { sndFile.m_tempoSwing = m_tempoSwing; - sndFile.m_tempoSwing.resize(sndFile.m_nDefaultRowsPerBeat, TempoSwing::Unity); - sndFile.m_tempoSwing.Normalize(); + sndFile.m_tempoSwing.resize(sndFile.m_nDefaultRowsPerBeat); } else { sndFile.m_tempoSwing.clear(); Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2015-06-13 17:17:54 UTC (rev 5313) +++ trunk/OpenMPT/mptrack/mptrack.rc 2015-06-13 19:58:53 UTC (rev 5314) @@ -1321,8 +1321,6 @@ CAPTION "Pattern Properties" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - DEFPUSHBUTTON "&OK",IDOK,132,6,50,14 - PUSHBUTTON "&Cancel",IDCANCEL,132,24,50,14 LTEXT "Rows:",IDC_STATIC,6,6,108,8 COMBOBOX IDC_COMBO1,6,18,48,93,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&/2",IDC_BUTTON_HALF,60,18,18,12 @@ -1336,6 +1334,8 @@ EDITTEXT IDC_ROWSPERMEASURE,18,84,30,12,ES_AUTOHSCROLL | ES_NUMBER CONTROL "",IDC_STATIC,"Static",SS_ETCHEDFRAME,6,102,174,1 LTEXT "Pattern Info",IDC_TEXT1,6,108,174,14 + DEFPUSHBUTTON "&OK",IDOK,132,6,50,14 + PUSHBUTTON "&Cancel",IDCANCEL,132,24,50,14 END IDD_PATTERN_EDITCOMMAND DIALOGEX 0, 0, 274, 95 Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2015-06-13 17:17:54 UTC (rev 5313) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2015-06-13 19:58:53 UTC (rev 5314) @@ -370,6 +370,7 @@ enum { Unity = 1u << 24 }; // Normalize the tempo swing coefficients so that they add up to exactly the specified tempo again void Normalize(); + void resize(size_type _Newsize, value_type val = Unity) { vector::resize(_Newsize, val); Normalize(); } static void Serialize(std::ostream &oStrm, const TempoSwing &swing); static void Deserialize(std::istream& iStrm, TempoSwing &swing, const size_t); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |