From: <re...@us...> - 2007-03-13 22:14:26
|
Revision: 174 http://svn.sourceforge.net/modplug/?rev=174&view=rev Author: rewbs Date: 2007-03-13 15:14:22 -0700 (Tue, 13 Mar 2007) Log Message: ----------- . v1.17.02.46 (in progress, no binary yet) / <rewbs> internal: renamed m_nSongPreAmp to m_nSamplePreAmp, to avoid confusion with global preamp. / <rewbs> internal: stubs for launching scripted pattern transforms. + <rewbs> new mixmode: bypass global preamp, provide explicit dB value for sample attenuation. WARNING: subject to change. + <rewbs> SCx now sends note off to VSTis at tick x. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_gen.h trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp trunk/OpenMPT/mptrack/SoundFilePlayConfig.h trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/bin/mptrack_P3.exe trunk/OpenMPT/mptrack/bin/mptrack_P4-Athlon64.exe trunk/OpenMPT/mptrack/bin/version trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb trunk/OpenMPT/soundlib/LOAD_DSM.CPP trunk/OpenMPT/soundlib/Load_far.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_med.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -6,6 +6,7 @@ #include "dlg_misc.h" #include "ctrl_gen.h" #include "view_gen.h" +#include "math.h" // -> CODE#0015 // -> DESC="channels management dlg" @@ -58,7 +59,7 @@ DDX_Control(pDX, IDC_SLIDER_SONGTEMPO, m_SliderTempo); DDX_Control(pDX, IDC_SLIDER_VSTIVOL, m_SliderVSTiVol); DDX_Control(pDX, IDC_SLIDER_GLOBALVOL, m_SliderGlobalVol); - DDX_Control(pDX, IDC_SLIDER_SONGPREAMP, m_SliderPreAmp); + DDX_Control(pDX, IDC_SLIDER_SAMPLEPREAMP, m_SliderSamplePreAmp); DDX_Control(pDX, IDC_EDIT_MODTYPE, m_EditModType); DDX_Control(pDX, IDC_COMBO_RESAMPLING, m_ComboResampling); @@ -91,12 +92,13 @@ m_SpinVSTiVol.SetRange(0, 2000); m_SpinRestartPos.SetRange(0, 255); - m_SliderPreAmp.SetRange(0, 500); m_SliderTempo.SetRange(0, 480); - m_SliderVSTiVol.SetRange(0, 500); - m_SliderGlobalVol.SetRange(0, 256); + m_SliderGlobalVol.SetRange(0, MAX_SLIDER_GLOBAL_VOL); + m_SliderVSTiVol.SetRange(0, MAX_SLIDER_VSTI_VOL); + m_SliderSamplePreAmp.SetRange(0, MAX_SLIDER_SAMPLE_VOL); + // -! BEHAVIOUR_CHANGE#0016 m_ComboResampling.AddString("None"); m_ComboResampling.AddString("Linear"); @@ -174,15 +176,15 @@ m_EditRestartPos.SetWindowText(s); wsprintf(s, "%d", m_pSndFile->m_nVSTiVolume); m_EditVSTiVol.SetWindowText(s); - wsprintf(s, "%d", m_pSndFile->m_nSongPreAmp); + wsprintf(s, "%d", m_pSndFile->m_nSamplePreAmp); m_EditSamplePA.SetWindowText(s); wsprintf(s, "%d", m_pSndFile->m_nRestartPos); m_EditRestartPos.SetWindowText(s); } - m_SliderGlobalVol.SetPos(256-m_pSndFile->m_nDefaultGlobalVolume); - m_SliderVSTiVol.SetPos(500-m_pSndFile->m_nVSTiVolume); - m_SliderPreAmp.SetPos(500-m_pSndFile->m_nSongPreAmp); + m_SliderGlobalVol.SetPos(MAX_SLIDER_GLOBAL_VOL-m_pSndFile->m_nDefaultGlobalVolume); + m_SliderVSTiVol.SetPos(MAX_SLIDER_VSTI_VOL-m_pSndFile->m_nVSTiVolume); + m_SliderSamplePreAmp.SetPos(MAX_SLIDER_SAMPLE_VOL-m_pSndFile->m_nSamplePreAmp); m_SliderTempo.SetPos(480 - m_pSndFile->m_nDefaultTempo + 32); @@ -202,7 +204,7 @@ m_SpinVSTiVol.EnableWindow(b); m_EditSamplePA.EnableWindow(b); m_SpinSamplePA.EnableWindow(b); - m_SliderPreAmp.EnableWindow(b); + m_SliderSamplePreAmp.EnableWindow(b); m_SliderVSTiVol.EnableWindow(b); // MOD Type @@ -259,8 +261,8 @@ } else if (pSlider==&m_SliderGlobalVol) { - int gv = 256 - m_SliderGlobalVol.GetPos(); - if ((gv >= 0) && (gv <= 256) && (gv != m_pSndFile->m_nDefaultGlobalVolume)) { + int gv = MAX_SLIDER_GLOBAL_VOL - m_SliderGlobalVol.GetPos(); + if ((gv >= 0) && (gv <= MAX_SLIDER_GLOBAL_VOL) && (gv != m_pSndFile->m_nDefaultGlobalVolume)) { m_pSndFile->m_nGlobalVolume = gv; m_pSndFile->m_nDefaultGlobalVolume = gv; m_pModDoc->SetModified(); @@ -268,18 +270,18 @@ } } - else if (pSlider==&m_SliderPreAmp) { - int spa = 500 - m_SliderPreAmp.GetPos(); - if ((spa >= 0) && (spa <= 500) && (spa != m_pSndFile->m_nSongPreAmp)) { - m_pSndFile->m_nSongPreAmp = spa; + else if (pSlider==&m_SliderSamplePreAmp) { + int spa = MAX_SLIDER_SAMPLE_VOL - m_SliderSamplePreAmp.GetPos(); + if ((spa >= 0) && (spa <= MAX_SLIDER_SAMPLE_VOL) && (spa != m_pSndFile->m_nSamplePreAmp)) { + m_pSndFile->m_nSamplePreAmp = spa; m_pModDoc->SetModified(); m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); } } else if (pSlider==&m_SliderVSTiVol) { - int vv = 500 - m_SliderVSTiVol.GetPos(); - if ((vv >= 0) && (vv <= 500) && (vv != m_pSndFile->m_nVSTiVolume)) { + int vv = MAX_SLIDER_VSTI_VOL - m_SliderVSTiVol.GetPos(); + if ((vv >= 0) && (vv <= MAX_SLIDER_VSTI_VOL) && (vv != m_pSndFile->m_nVSTiVolume)) { m_pSndFile->m_nVSTiVolume = vv; m_pSndFile->RecalculateGainForAllPlugs(); m_pModDoc->SetModified(); @@ -392,9 +394,9 @@ m_EditSamplePA.GetWindowText(s, sizeof(s)); if (s[0]) { int n = atoi(s); - if ((n >= 0) && (n <= 2000) && (n != m_pSndFile->m_nSongPreAmp)) { + if ((n >= 0) && (n <= 2000) && (n != m_pSndFile->m_nSamplePreAmp)) { m_bEditsLocked=true; - m_pSndFile->m_nSongPreAmp = n; + m_pSndFile->m_nSamplePreAmp = n; m_pModDoc->SetModified(); m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); UpdateView(HINT_MODGENERAL, NULL); @@ -607,7 +609,54 @@ } +BOOL CCtrlGeneral::GetToolTipText(UINT uId, LPSTR pszText) { +//---------------------------------------------------------- + if ((pszText) && (uId)) + { + if (!m_pSndFile->m_pConfig->getDisplayDBValues()) { + wsprintf(pszText, "Use a more recent mixmode to see dB offsets."); + return TRUE; + } + + switch(uId) { + case IDC_SLIDER_SAMPLEPREAMP: + setAsDecibels(pszText, m_pSndFile->m_nSamplePreAmp, m_pSndFile->m_pConfig->getNormalSamplePreAmp()); + return TRUE; + break; + case IDC_SLIDER_VSTIVOL: + setAsDecibels(pszText, m_pSndFile->m_nVSTiVolume, m_pSndFile->m_pConfig->getNormalVSTiVol()); + return TRUE; + break; + case IDC_SLIDER_GLOBALVOL: + setAsDecibels(pszText, m_pSndFile->m_nGlobalVolume, m_pSndFile->m_pConfig->getNormalGlobalVol()); + return TRUE; + break; + } + } + return FALSE; + +} + +void CCtrlGeneral::setAsDecibels(LPSTR stringToSet, double value, double valueAtZeroDB) { +//------------------------------------------------------------------------------------- + + if (value==0) { + wsprintf(stringToSet, "-inf"); + return; + } + + double changeFactor = value / valueAtZeroDB; + double dB = 10*log(changeFactor); + + char sign = (dB>=0)?'+':' '; + sprintf(stringToSet, "%c%.2f dB", sign, dB); + return; + +} + + + //////////////////////////////////////////////////////////////////////////////// // // CVuMeter @@ -672,3 +721,5 @@ SelectObject(hdc, oldpen); m_nDisplayedVu = m_nVuMeter; } + + Modified: trunk/OpenMPT/mptrack/Ctrl_gen.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.h 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/Ctrl_gen.h 2007-03-13 22:14:22 UTC (rev 174) @@ -20,7 +20,13 @@ DECLARE_MESSAGE_MAP(); }; +enum { + MAX_SLIDER_GLOBAL_VOL=256, + MAX_SLIDER_VSTI_VOL=256, + MAX_SLIDER_SAMPLE_VOL=256 +}; + //======================================= class CCtrlGeneral: public CModControlDlg //======================================= @@ -29,6 +35,9 @@ CCtrlGeneral(); LONG* GetSplitPosRef() {return &CMainFrame::glGeneralWindowHeight;} //rewbs.varWindowSize +private: + void setAsDecibels(LPSTR stringToSet, double value, double valueAtZeroDB); + public: bool m_bEditsLocked; //{{AFX_DATA(CCtrlGeneral) @@ -39,7 +48,7 @@ CSpinButtonCtrl m_SpinTempo, m_SpinSpeed, m_SpinGlobalVol, m_SpinRestartPos, m_SpinSamplePA, m_SpinVSTiVol; - CSliderCtrl m_SliderTempo, m_SliderPreAmp, m_SliderGlobalVol, m_SliderVSTiVol; + CSliderCtrl m_SliderTempo, m_SliderSamplePreAmp, m_SliderGlobalVol, m_SliderVSTiVol; CComboBox m_ComboResampling; CVuMeter m_VuMeterLeft, m_VuMeterRight; //}}AFX_DATA @@ -51,6 +60,7 @@ virtual CRuntimeClass *GetAssociatedViewClass(); virtual void OnActivatePage(LPARAM); virtual void OnDeactivatePage(); + virtual BOOL GetToolTipText(UINT uId, LPSTR pszText); //}}AFX_VIRTUAL protected: //{{AFX_MSG(CCtrlGeneral) Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -1973,7 +1973,13 @@ StopSoundFile(&m_WaveFile); m_WaveFile.Destroy(); m_WaveFile.Create(NULL, 0); + + //Avoid global volume ramping when trying samples in the treeview. + m_WaveFile.m_pConfig->setGlobalVolumeAppliesToMaster(false); + m_WaveFile.m_nDefaultGlobalVolume=64; + m_WaveFile.m_nDefaultTempo = 125; + m_WaveFile.m_nGlobalVolume=64; m_WaveFile.m_nDefaultSpeed = 4; m_WaveFile.m_nRepeatCount = 0; m_WaveFile.m_nType = MOD_TYPE_IT; Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -604,7 +604,7 @@ strcpy(m_SndFile.m_szNames[0], "untitled"); m_SndFile.m_nMusicTempo = m_SndFile.m_nDefaultTempo = 125; m_SndFile.m_nMusicSpeed = m_SndFile.m_nDefaultSpeed = 6; - m_SndFile.m_nGlobalVolume = m_SndFile.m_nDefaultGlobalVolume = 128; + m_SndFile.m_nGlobalVolume = m_SndFile.m_nDefaultGlobalVolume = 256; for (UINT init=0; init<MAX_BASECHANNELS; init++) { m_SndFile.ChnSettings[init].dwFlags = 0; Modified: trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp =================================================================== --- trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -3,7 +3,7 @@ CSoundFilePlayConfig::CSoundFilePlayConfig(void) { - SetPluginMixLevels(plugmix_mode_117RC2); + SetPluginMixLevels(plugmix_mode_117RC3); setVSTiVolume(1.0f); } @@ -20,6 +20,12 @@ setIntToFloat(1.0f/static_cast<float>(1<<28)); setFloatToInt(static_cast<float>(1<<28)); setGlobalVolumeAppliesToMaster(false); + setUseGlobalPreAmp(true); + setTreatPanLikeBalance(false); + setDisplayDBValues(false); + setNormalSamplePreAmp(128.0); + setNormalVSTiVol(100.0); + setNormalGlobalVol(128.0); break; // Ericus' version gives us floats in [-0.06;0.06] and requires attenuation to @@ -29,18 +35,29 @@ setIntToFloat(1.0f/static_cast<float>(0x07FFFFFFF)); setFloatToInt(static_cast<float>(0x07FFFFFFF)); setGlobalVolumeAppliesToMaster(false); + setUseGlobalPreAmp(true); + setTreatPanLikeBalance(false); + setDisplayDBValues(false); + setNormalSamplePreAmp(128.0); + setNormalVSTiVol(100.0); + setNormalGlobalVol(128.0); break; // FOR TEST PURPOSES ONLY: case plugmix_mode_Test: - setVSTiAttenuation(2.0f); + setVSTiAttenuation(1.0f); setIntToFloat(1.0f/static_cast<float>(MIXING_CLIPMAX)); setFloatToInt(static_cast<float>(MIXING_CLIPMAX)); - setGlobalVolumeAppliesToMaster(false); + setGlobalVolumeAppliesToMaster(true); + setUseGlobalPreAmp(false); + setTreatPanLikeBalance(true); + setDisplayDBValues(true); + setNormalSamplePreAmp(128.0); + setNormalVSTiVol(128.0); + setNormalGlobalVol(256.0); break; - - // 117RC2 applies Rewbs' version gives us floats in [-1.0; 1.0] and hopefully plays VSTis at + // 117RC2 gives us floats in [-1.0; 1.0] and hopefully plays VSTis at // the right volume... but we attenuate by 2x to approx. match sample volume. default: case plugmix_mode_117RC2: @@ -48,6 +65,28 @@ setIntToFloat(1.0f/static_cast<float>(MIXING_CLIPMAX)); setFloatToInt(static_cast<float>(MIXING_CLIPMAX)); setGlobalVolumeAppliesToMaster(true); + setUseGlobalPreAmp(true); + setTreatPanLikeBalance(false); + setDisplayDBValues(false); + setNormalSamplePreAmp(128.0); + setNormalVSTiVol(100.0); + setNormalGlobalVol(128.0); + + // 117RC3 ignores the horrible global, system-specific pre-amp, + // treats panning as balance to avoid saturation on loud sample (and because I think it's better :), + // and allows display of attenuation in decibels. + case plugmix_mode_117RC3: + setVSTiAttenuation(1.0f); + setIntToFloat(1.0f/static_cast<float>(MIXING_CLIPMAX)); + setFloatToInt(static_cast<float>(MIXING_CLIPMAX)); + setGlobalVolumeAppliesToMaster(true); + setUseGlobalPreAmp(false); + setTreatPanLikeBalance(true); + setDisplayDBValues(true); + setNormalSamplePreAmp(128.0); + setNormalVSTiVol(128.0); + setNormalGlobalVol(256.0); + break; } return; @@ -57,12 +96,12 @@ //getters and setters. bool CSoundFilePlayConfig::getGlobalVolumeAppliesToMaster() { - return m_bGlobalVolumeAppliesToMaster; + return m_globalVolumeAppliesToMaster; } void CSoundFilePlayConfig::setGlobalVolumeAppliesToMaster(bool inGlobalVolumeAppliesToMaster){ - m_bGlobalVolumeAppliesToMaster=inGlobalVolumeAppliesToMaster; + m_globalVolumeAppliesToMaster=inGlobalVolumeAppliesToMaster; } float CSoundFilePlayConfig::getVSTiGainFactor() { @@ -105,3 +144,54 @@ m_FloatToInt=inFloatToInt; } +bool CSoundFilePlayConfig::getUseGlobalPreAmp() { + return m_ignorePreAmp; +} + +void CSoundFilePlayConfig::setUseGlobalPreAmp(bool inUseGlobalPreAmp) { + m_ignorePreAmp=inUseGlobalPreAmp; +} + + +bool CSoundFilePlayConfig::getTreatPanLikeBalance() { + return m_treatPanLikeBalance; +} + +void CSoundFilePlayConfig::setTreatPanLikeBalance(bool inTreatPanLikeBalance) { + m_treatPanLikeBalance=inTreatPanLikeBalance; +} + +void CSoundFilePlayConfig::setDisplayDBValues(bool in) { + m_displayDBValues=in; +} + +void CSoundFilePlayConfig::setNormalSamplePreAmp(double in) { + m_normalSamplePreAmp=in; +} + +void CSoundFilePlayConfig::setNormalVSTiVol(double in) { + m_normalVSTiVol=in; +} + +void CSoundFilePlayConfig::setNormalGlobalVol(double in) { + m_normalGlobalVol=in; +} + +bool CSoundFilePlayConfig::getDisplayDBValues() { + return m_displayDBValues; +} + +double CSoundFilePlayConfig::getNormalSamplePreAmp() { + return m_normalSamplePreAmp; +} + +double CSoundFilePlayConfig::getNormalVSTiVol() { + return m_normalVSTiVol; +} + +double CSoundFilePlayConfig::getNormalGlobalVol() { + return m_normalGlobalVol; +} + + + Modified: trunk/OpenMPT/mptrack/SoundFilePlayConfig.h =================================================================== --- trunk/OpenMPT/mptrack/SoundFilePlayConfig.h 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/SoundFilePlayConfig.h 2007-03-13 22:14:22 UTC (rev 174) @@ -16,7 +16,8 @@ plugmix_mode_original = 0, plugmix_mode_117RC1 = 1, plugmix_mode_117RC2 = 2, - plugmix_mode_Test = 3, + plugmix_mode_117RC3 = 3, + plugmix_mode_Test = 4, }; // Class used to store settings for a song file. @@ -34,30 +35,55 @@ float getFloatToInt(); void setFloatToInt(float); + // default VSTi gain factor, different depending on the MPT version we're "emulating" void setVSTiAttenuation(float); float getVSTiAttenuation(); + + // user-controllable VSTi gain factor. void setVSTiVolume(float); float getVSTiVolume(); - void setGlobalVolumeAppliesToMaster(bool); + void setGlobalVolumeAppliesToMaster(bool); bool getGlobalVolumeAppliesToMaster(); + void setUseGlobalPreAmp(bool); + bool getUseGlobalPreAmp(); -//calculated internally (getters only): - float getVSTiGainFactor(); + void setTreatPanLikeBalance(bool); + bool getTreatPanLikeBalance(); + void setDisplayDBValues(bool); + bool getDisplayDBValues(); + //Values at which volumes are unchanged + double getNormalSamplePreAmp(); + double getNormalVSTiVol(); + double getNormalGlobalVol(); + void setNormalSamplePreAmp(double); + void setNormalVSTiVol(double); + void setNormalGlobalVol(double); -// private: + +//calculated internally (getters only): + float getVSTiGainFactor(); + float m_IntToFloat; float m_FloatToInt; - float m_VSTiAttenuation; // default VSTi gain factor, different depending on the MPT version we're "emulating" - float m_VSTiVolume; // user-controllable VSTi gain factor. + float m_VSTiAttenuation; + float m_VSTiVolume; float m_VSTiGainFactor; // always m_VSTiAttenuation * m_VSTiVolume. No public setter. - bool m_bGlobalVolumeAppliesToMaster; + float m_normalSamplePreAmp; + float m_normalVSTiVol; + float m_normalGlobalVol; + bool m_globalVolumeAppliesToMaster; + bool m_ignorePreAmp; + bool m_treatPanLikeBalance; + bool m_displayDBValues; + DWORD m_LastSavedWithVersion; DWORD m_CreatedWithVersion; }; + Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -79,6 +79,7 @@ ON_COMMAND(ID_PREVORDER, OnPrevOrder) ON_COMMAND(ID_NEXTORDER, OnNextOrder) ON_COMMAND(IDC_PATTERN_RECORD, OnPatternRecord) + ON_COMMAND(ID_RUN_SCRIPT, OnRunScript) ON_COMMAND(ID_TRANSPOSE_UP, OnTransposeUp) ON_COMMAND(ID_TRANSPOSE_DOWN, OnTransposeDown) ON_COMMAND(ID_TRANSPOSE_OCTUP, OnTransposeOctUp) @@ -2447,7 +2448,13 @@ EndWaitCursor(); } +void CViewPattern::OnRunScript() +//-------------------------------- +{ + ; +} + void CViewPattern::OnTransposeUp() //-------------------------------- { @@ -4525,6 +4532,8 @@ CArray<UINT, UINT> validChans; DWORD greyed = (ListChansWhereColSelected(NOTE_COLUMN, validChans)>0)?FALSE:MF_GRAYED; + //AppendMenu(hMenu, MF_STRING, ID_RUN_SCRIPT, "Run script"); + if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) { AppendMenu(hMenu, MF_STRING|greyed, ID_TRANSPOSE_UP, "Transpose +1\t" + ih->GetKeyTextFromCommand(kcTransposeUp)); AppendMenu(hMenu, MF_STRING|greyed, ID_TRANSPOSE_DOWN, "Transpose -1\t" + ih->GetKeyTextFromCommand(kcTransposeDown)); Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/View_pat.h 2007-03-13 22:14:22 UTC (rev 174) @@ -266,6 +266,7 @@ afx_msg void OnInterpolateNote(); afx_msg void OnVisualizeEffect(); //rewbs.fxvis afx_msg void OnOpenRandomizer(); //rewbs.fxvis + afx_msg void OnRunScript(); afx_msg void OnTransposeUp(); afx_msg void OnTransposeDown(); afx_msg void OnTransposeOctUp(); Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -2035,7 +2035,7 @@ if (m_bIsInstrument) { gain /= m_pSndFile->m_pConfig->getVSTiAttenuation(); - gain *= (m_pSndFile->m_nVSTiVolume / 100.0f); + gain *= (m_pSndFile->m_nVSTiVolume / m_pSndFile->m_pConfig->getNormalVSTiVol()); } m_fGain = gain; } @@ -2091,6 +2091,7 @@ } } */ + void CVstPlugin::Process(float *pOutL, float *pOutR, unsigned long nSamples) //-------------------------------------------------------------------------- { Modified: trunk/OpenMPT/mptrack/bin/mptrack_P3.exe =================================================================== (Binary files differ) Modified: trunk/OpenMPT/mptrack/bin/mptrack_P4-Athlon64.exe =================================================================== (Binary files differ) Modified: trunk/OpenMPT/mptrack/bin/version =================================================================== --- trunk/OpenMPT/mptrack/bin/version 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/bin/version 2007-03-13 22:14:22 UTC (rev 174) @@ -1 +1 @@ -1.17.02.45 \ No newline at end of file +1.17.02.46 \ No newline at end of file Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -248,21 +248,21 @@ default: m_TempoModeBox.SetCurSel(0); break; } + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC3"), plugmix_mode_117RC3); m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC2"), plugmix_mode_117RC2); m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), plugmix_mode_117RC1); m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Original"), plugmix_mode_original); -// m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Test"), plugmix_mode_Test); + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Test"), plugmix_mode_Test); switch(m_pSndFile->m_nPlugMixMode) { - case plugmix_mode_original: m_PlugMixBox.SetCurSel(2); break; - case plugmix_mode_117RC1: m_PlugMixBox.SetCurSel(1); break; -// case plugmix_mode_Test: m_PlugMixBox.SetCurSel(3); break; - case plugmix_mode_117RC2: + //case plugmix_mode_Test: m_PlugMixBox.SetCurSel(3); break; + case plugmix_mode_original: m_PlugMixBox.SetCurSel(3); break; + case plugmix_mode_117RC1: m_PlugMixBox.SetCurSel(2); break; + case plugmix_mode_117RC2: m_PlugMixBox.SetCurSel(1); break; + case plugmix_mode_117RC3: default: m_PlugMixBox.SetCurSel(0); break; } -; - SetDlgItemText(IDC_EDIT5, "Created with:"); SetDlgItemText(IDC_EDIT6, "Last saved with:"); Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/mptrack.rc 2007-03-13 22:14:22 UTC (rev 174) @@ -542,21 +542,22 @@ GROUPBOX "",IDC_STATIC,83,14,175,78 LTEXT "Initial global vol:",IDC_STATIC,90,20,52,8 CONTROL "",IDC_SLIDER_GLOBALVOL,"msctls_trackbar32",TBS_VERT | - TBS_BOTH | TBS_NOTICKS,105,28,15,50 + TBS_BOTH | TBS_NOTICKS | TBS_TOOLTIPS,105,28,15,50 EDITTEXT IDC_EDIT_GLOBALVOL,95,78,36,12,ES_NUMBER CONTROL "",IDC_SPIN_GLOBALVOL,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,120,76, 11,14 LTEXT "VSTi vol:",IDC_STATIC,159,20,33,8 CONTROL "",IDC_SLIDER_VSTIVOL,"msctls_trackbar32",TBS_VERT | - TBS_BOTH | TBS_NOTICKS,164,28,15,50 + TBS_BOTH | TBS_NOTICKS | TBS_TOOLTIPS,164,28,15,50 EDITTEXT IDC_EDIT_VSTIVOL,156,78,36,12,ES_NUMBER CONTROL "",IDC_SPIN_VSTIVOL,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,180,76, 11,14 LTEXT "Sample vol:",IDC_STATIC,212,20,38,8 - CONTROL "Slider1",IDC_SLIDER_SONGPREAMP,"msctls_trackbar32", - TBS_VERT | TBS_BOTH | TBS_NOTICKS,221,28,15,50 + CONTROL "Slider1",IDC_SLIDER_SAMPLEPREAMP,"msctls_trackbar32", + TBS_VERT | TBS_BOTH | TBS_NOTICKS | TBS_TOOLTIPS,221,28, + 15,50 EDITTEXT IDC_EDIT_SAMPLEPA,212,78,36,12,ES_NUMBER CONTROL "",IDC_SPIN_SAMPLEPA,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_NOTHOUSANDS,238,75, @@ -931,10 +932,10 @@ WS_TABSTOP GROUPBOX "Tempo",IDC_STATIC,4,51,235,38 LTEXT "Mode:",IDC_STATIC,7,62,21,8 - COMBOBOX IDC_COMBO4,156,129,81,51,CBS_DROPDOWNLIST | WS_VSCROLL | + COMBOBOX IDC_COMBO4,153,129,81,51,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP GROUPBOX "Playback",IDC_STATIC,4,95,235,51 - LTEXT "Plugin levels:",IDC_STATIC,111,131,43,10 + LTEXT "Mix Levels:",IDC_STATIC,111,131,40,10 GROUPBOX "OpenMPT Version Info",IDC_STATIC,4,150,235,42 EDITTEXT IDC_EDIT1,67,161,166,13,ES_AUTOHSCROLL | ES_READONLY, WS_EX_STATICEDGE @@ -1905,7 +1906,7 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,17,2,45 + FILEVERSION 1,17,2,46 PRODUCTVERSION 0,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG @@ -1923,7 +1924,7 @@ BEGIN VALUE "CompanyName", "Olivier Lapicque / OpenMPT team" VALUE "FileDescription", "OpenMPT / ModPlug Tracker" - VALUE "FileVersion", "1, 17, 2, 45" + VALUE "FileVersion", "1, 17, 2, 46" VALUE "InternalName", "Modplug Tracker" VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2007 GPL." VALUE "LegalTrademarks", "M.O.D.P.L.U.G" Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/mptrack/resource.h 2007-03-13 22:14:22 UTC (rev 174) @@ -533,7 +533,7 @@ #define IDC_EDIT_SPEED 2008 #define IDC_EDIT_GLOBALVOL 2009 #define IDC_EDIT_RESTARTPOS 2010 -#define IDC_SLIDER_SONGPREAMP 2011 +#define IDC_SLIDER_SAMPLEPREAMP 2011 #define IDC_BUTTON_MODTYPE 2012 #define IDC_EDIT_SAMPLEPA 2013 #define IDC_EDIT_MODTYPE 2014 @@ -728,7 +728,7 @@ #define IDC_AUTOSAVE_USECUSTOMDIR 2245 #define IDC_BUTTON_MODTYPE2 2246 #define IDC_BUTTON_PLAYERPROPS 2247 -#define IDC_SLIDER_SONGPREAMP3 2248 +#define IDC_SLIDER_SAMPLEPREAMP3 2248 #define IDC_SLIDER_GLOBALVOL 2249 #define IDC_EDIT_VSTIVOL 2250 #define IDC_SLIDER_VSTIVOL 2251 @@ -930,6 +930,7 @@ #define ID_VIEW_SONGPROPERTIES 38002 #define ID_GROW_SELECTION 40001 #define ID_SHRINK_SELECTION 40002 +#define ID_RUN_SCRIPT 40003 #define IDS_ERR_FILEOPEN 55001 #define IDS_ERR_FILETYPE 55002 #define IDS_ERR_SAVEINS 55003 Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb 2007-03-13 22:14:22 UTC (rev 174) @@ -9,7 +9,7 @@ 0:1349:2:83:1 //File/Save: Ctrl+S (KeyDown) 0:1030:2:119:1 //Play song/Pause song: Ctrl+F8 (KeyDown) 0:1031:0:119:1 //Pause song: F8 (KeyDown) -0:1375:0:27:1 //Stop Song: ESC (KeyDown) +0:1375:0:27:1 //Stop Song: Esc (KeyDown) 0:1029:0:116:5 //Play song from start: F5 (KeyDown|KeyHold) 0:1028:0:118:5 //Play song from cursor: F7 (KeyDown|KeyHold) 0:1027:0:117:5 //Play pattern from start: F6 (KeyDown|KeyHold) @@ -36,49 +36,49 @@ 0:1670:6:77:1 //View Channel Manager: Ctrl+Alt+M (KeyDown) 0:1669:3:77:1 //View Plugin Manager: Shift+Ctrl+M (KeyDown) 0:1032:0:219:5 //Previous instrument: [ (KeyDown|KeyHold) -0:1032:2:38:5 //Previous instrument: Ctrl+UP (KeyDown|KeyHold) +0:1032:2:38:5 //Previous instrument: Ctrl+Up (KeyDown|KeyHold) 0:1033:0:221:5 //Next instrument: ] (KeyDown|KeyHold) -0:1033:2:40:5 //Next instrument: Ctrl+DOWN (KeyDown|KeyHold) -0:1036:0:111:5 //Previous octave: NUM DIVIDE (KeyDown|KeyHold) -0:1037:0:106:5 //Next octave: NUMMULT (KeyDown|KeyHold) -0:1034:2:37:5 //Previous order: Ctrl+LEFT (KeyDown|KeyHold) -0:1035:2:39:5 //Next order: Ctrl+RIGHT (KeyDown|KeyHold) +0:1033:2:40:5 //Next instrument: Ctrl+Down (KeyDown|KeyHold) +0:1036:0:111:5 //Previous octave: Num / (KeyDown|KeyHold) +0:1037:0:106:5 //Next octave: Num * (KeyDown|KeyHold) +0:1034:2:37:5 //Previous order: Ctrl+Left (KeyDown|KeyHold) +0:1035:2:39:5 //Next order: Ctrl+Right (KeyDown|KeyHold) //----( General Context [bottom] (1) )------------ //----( Pattern Context [bottom] (2) )------------ -2:1017:0:34:5 //Jump down by measure: PGDOWN (KeyDown|KeyHold) -2:1018:0:33:5 //Jump up by measure: PGUP (KeyDown|KeyHold) -2:1338:4:34:5 //Jump down by beat: Alt+PGDOWN (KeyDown|KeyHold) -2:1339:4:33:5 //Jump up by beat: Alt+PGUP (KeyDown|KeyHold) -2:1019:2:34:5 //Snap down to measure: Ctrl+PGDOWN (KeyDown|KeyHold) -2:1020:2:33:5 //Snap up to measure: Ctrl+PGUP (KeyDown|KeyHold) -2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+PGDOWN (KeyDown|KeyHold) -2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+PGUP (KeyDown|KeyHold) -2:1038:0:40:5 //Navigate down by 1 row: DOWN (KeyDown|KeyHold) -2:1039:0:38:5 //Navigate up by 1 row: UP (KeyDown|KeyHold) -2:1040:0:37:5 //Navigate left: LEFT (KeyDown|KeyHold) -2:1041:0:39:5 //Navigate right: RIGHT (KeyDown|KeyHold) -2:1042:0:9:5 //Navigate to next channel: TAB (KeyDown|KeyHold) -2:1043:2:9:5 //Navigate to previous channel: Ctrl+TAB (KeyDown|KeyHold) -2:1044:0:36:1 //Go to first channel: HOME (KeyDown) -2:1045:2:36:1 //Go to first row: Ctrl+HOME (KeyDown) -2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+HOME (KeyDown) -2:1047:0:35:1 //Go to last channel: END (KeyDown) -2:1048:2:35:1 //Go to last row: Ctrl+END (KeyDown) -2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+END (KeyDown) -2:1050:1:16:1 //Selection key: Shift (KeyDown) +2:1017:0:34:5 //Jump down by measure: Page Down (KeyDown|KeyHold) +2:1018:0:33:5 //Jump up by measure: Page Up (KeyDown|KeyHold) +2:1338:4:34:5 //Jump down by beat: Alt+Page Down (KeyDown|KeyHold) +2:1339:4:33:5 //Jump up by beat: Alt+Page Up (KeyDown|KeyHold) +2:1019:2:34:5 //Snap down to measure: Ctrl+Page Down (KeyDown|KeyHold) +2:1020:2:33:5 //Snap up to measure: Ctrl+Page Up (KeyDown|KeyHold) +2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+Page Down (KeyDown|KeyHold) +2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+Page Up (KeyDown|KeyHold) +2:1038:0:40:5 //Navigate down by 1 row: Down (KeyDown|KeyHold) +2:1039:0:38:5 //Navigate up by 1 row: Up (KeyDown|KeyHold) +2:1040:0:37:5 //Navigate left: Left (KeyDown|KeyHold) +2:1041:0:39:5 //Navigate right: Right (KeyDown|KeyHold) +2:1042:0:9:5 //Navigate to next channel: Tab (KeyDown|KeyHold) +2:1043:2:9:5 //Navigate to previous channel: Ctrl+Tab (KeyDown|KeyHold) +2:1044:0:36:1 //Go to first channel: Home (KeyDown) +2:1045:2:36:1 //Go to first row: Ctrl+Home (KeyDown) +2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+Home (KeyDown) +2:1047:0:35:1 //Go to last channel: End (KeyDown) +2:1048:2:35:1 //Go to last row: Ctrl+End (KeyDown) +2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+End (KeyDown) +2:1050:1:16:1 //Selection key: Shift+Shift (KeyDown) 2:1011:4:76:1 //Select channel / Select all: Alt+L (KeyDown) 2:1663:2:118:1 //Toggle follow song: Ctrl+F7 (KeyDown) -2:1003:0:13:1 //Quick copy: ENTER (KeyDown) -2:1004:0:32:5 //Quick paste: SPACE (KeyDown|KeyHold) +2:1003:0:13:1 //Quick copy: Enter (KeyDown) +2:1004:0:32:5 //Quick paste: Space (KeyDown|KeyHold) 2:1001:1:120:1 //Enable recording: Shift+F9 (KeyDown) -2:1002:2:13:1 //Play row: Ctrl+ENTER (KeyDown) -2:1002:0:104:1 //Play row: NUM 8 (KeyDown) +2:1002:2:13:1 //Play row: Ctrl+Enter (KeyDown) +2:1002:0:104:1 //Play row: Num 8 (KeyDown) 2:1002:0:56:1 //Play row: 8 (KeyDown) -2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown) -2:1685:6:9:1 //Switch to order list: Ctrl+Alt+TAB (KeyDown) -2:1672:3:13:1 //Insert new pattern: Shift+Ctrl+ENTER (KeyDown) +2:1317:4:18:1 //Set row jump on note entry: Alt+Alt (KeyDown) +2:1685:6:9:1 //Switch to order list: Ctrl+Alt+Tab (KeyDown) +2:1672:3:13:1 //Insert new pattern: Shift+Ctrl+Enter (KeyDown) 2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown) 2:1062:0:93:1 //Show note properties: Application (KeyDown) 2:1063:2:93:1 //Show context (right-click) menu: Ctrl+Application (KeyDown) @@ -95,110 +95,110 @@ 2:1013:4:83:1 //Apply current instrument: Alt+S (KeyDown) 2:1660:4:69:1 //Grow selection: Alt+E (KeyDown) 2:1661:4:68:1 //Shrink selection: Alt+D (KeyDown) -2:1057:0:46:1 //Clear row: DELETE (KeyDown) -2:1058:0:110:1 //Clear field: NUM DECIMAL (KeyDown) +2:1057:0:46:1 //Clear row: Delete (KeyDown) +2:1058:0:110:1 //Clear field: Num Del (KeyDown) 2:1664:1:190:1 //Clear field (IT Style): Shift+. (KeyDown) -2:1059:2:46:1 //Clear row and step: Ctrl+DELETE (KeyDown) -2:1060:2:110:1 //Clear field and step: Ctrl+NUM DECIMAL (KeyDown) +2:1059:2:46:1 //Clear row and step: Ctrl+Delete (KeyDown) +2:1060:2:110:1 //Clear field and step: Ctrl+Num Del (KeyDown) 2:1665:3:190:1 //Clear field and step (IT Style): Shift+Ctrl+. (KeyDown) -2:1061:0:8:5 //Delete rows: BACKSPACE (KeyDown|KeyHold) -2:1377:2:8:5 //Delete all rows: Ctrl+BACKSPACE (KeyDown|KeyHold) -2:1378:0:45:5 //Insert Row: INSERT (KeyDown|KeyHold) -2:1379:2:45:1 //Insert All Rows: Ctrl+INSERT (KeyDown) -2:1055:0:109:5 //Previous pattern: NUM SUB (KeyDown|KeyHold) -2:1054:0:107:5 //Next pattern: NUM PLUS (KeyDown|KeyHold) +2:1061:0:8:5 //Delete rows: Backspace (KeyDown|KeyHold) +2:1377:2:8:5 //Delete all rows: Ctrl+Backspace (KeyDown|KeyHold) +2:1378:0:45:5 //Insert Row: Insert (KeyDown|KeyHold) +2:1379:2:45:1 //Insert All Rows: Ctrl+Insert (KeyDown) +2:1055:0:109:5 //Previous pattern: Num - (KeyDown|KeyHold) +2:1054:0:107:5 //Next pattern: Num + (KeyDown|KeyHold) //----( Pattern Context [bottom] - Note Col (3) )------------ -3:1064:0:90:5 //Base octave C: Z (KeyDown|KeyHold) -3:1065:0:83:5 //Base octave C#: S (KeyDown|KeyHold) -3:1066:0:88:5 //Base octave D: X (KeyDown|KeyHold) -3:1067:0:68:5 //Base octave D#: D (KeyDown|KeyHold) -3:1068:0:67:5 //Base octave E: C (KeyDown|KeyHold) -3:1069:0:86:5 //Base octave F: V (KeyDown|KeyHold) -3:1070:0:71:5 //Base octave F#: G (KeyDown|KeyHold) -3:1071:0:66:5 //Base octave G: B (KeyDown|KeyHold) -3:1072:0:72:5 //Base octave G#: H (KeyDown|KeyHold) -3:1073:0:78:5 //Base octave +1 A: N (KeyDown|KeyHold) -3:1074:0:74:5 //Base octave +1 A#: J (KeyDown|KeyHold) -3:1075:0:77:5 //Base octave +1 B: M (KeyDown|KeyHold) -3:1076:0:81:5 //Base octave +1 C: Q (KeyDown|KeyHold) -3:1077:0:50:5 //Base octave +1 C#: 2 (KeyDown|KeyHold) -3:1078:0:87:5 //Base octave +1 D: W (KeyDown|KeyHold) -3:1079:0:51:5 //Base octave +1 D#: 3 (KeyDown|KeyHold) -3:1080:0:69:5 //Base octave +1 E: E (KeyDown|KeyHold) -3:1081:0:82:5 //Base octave +1 F: R (KeyDown|KeyHold) -3:1082:0:53:5 //Base octave +1 F#: 5 (KeyDown|KeyHold) -3:1083:0:84:5 //Base octave +1 G: T (KeyDown|KeyHold) -3:1084:0:54:5 //Base octave +1 G#: 6 (KeyDown|KeyHold) -3:1085:0:89:5 //Base octave +2 A: Y (KeyDown|KeyHold) -3:1086:0:55:5 //Base octave +2 A#: 7 (KeyDown|KeyHold) -3:1087:0:85:5 //Base octave +2 B: U (KeyDown|KeyHold) -3:1088:0:73:5 //Base octave +2 C: I (KeyDown|KeyHold) -3:1089:0:57:5 //Base octave +2 C#: 9 (KeyDown|KeyHold) -3:1090:0:79:5 //Base octave +2 D: O (KeyDown|KeyHold) -3:1091:0:48:5 //Base octave +2 D#: 0 (KeyDown|KeyHold) -3:1092:0:80:5 //Base octave +2 E: P (KeyDown|KeyHold) -3:1212:0:96:1 //Set octave 0: NUM 0 (KeyDown) -3:1213:0:97:1 //Set octave 1: NUM 1 (KeyDown) -3:1214:0:98:1 //Set octave 2: NUM 2 (KeyDown) -3:1215:0:99:1 //Set octave 3: NUM 3 (KeyDown) +3:1064:0:90:1 //Base octave C: Z (KeyDown) +3:1065:0:83:1 //Base octave C#: S (KeyDown) +3:1066:0:88:1 //Base octave D: X (KeyDown) +3:1067:0:68:1 //Base octave D#: D (KeyDown) +3:1068:0:67:1 //Base octave E: C (KeyDown) +3:1069:0:86:1 //Base octave F: V (KeyDown) +3:1070:0:71:1 //Base octave F#: G (KeyDown) +3:1071:0:66:1 //Base octave G: B (KeyDown) +3:1072:0:72:1 //Base octave G#: H (KeyDown) +3:1073:0:78:1 //Base octave +1 A: N (KeyDown) +3:1074:0:74:1 //Base octave +1 A#: J (KeyDown) +3:1075:0:77:1 //Base octave +1 B: M (KeyDown) +3:1076:0:81:1 //Base octave +1 C: Q (KeyDown) +3:1077:0:50:1 //Base octave +1 C#: 2 (KeyDown) +3:1078:0:87:1 //Base octave +1 D: W (KeyDown) +3:1079:0:51:1 //Base octave +1 D#: 3 (KeyDown) +3:1080:0:69:1 //Base octave +1 E: E (KeyDown) +3:1081:0:82:1 //Base octave +1 F: R (KeyDown) +3:1082:0:53:1 //Base octave +1 F#: 5 (KeyDown) +3:1083:0:84:1 //Base octave +1 G: T (KeyDown) +3:1084:0:54:1 //Base octave +1 G#: 6 (KeyDown) +3:1085:0:89:1 //Base octave +2 A: Y (KeyDown) +3:1086:0:55:1 //Base octave +2 A#: 7 (KeyDown) +3:1087:0:85:1 //Base octave +2 B: U (KeyDown) +3:1088:0:73:1 //Base octave +2 C: I (KeyDown) +3:1089:0:57:1 //Base octave +2 C#: 9 (KeyDown) +3:1090:0:79:1 //Base octave +2 D: O (KeyDown) +3:1091:0:48:1 //Base octave +2 D#: 0 (KeyDown) +3:1092:0:80:1 //Base octave +2 E: P (KeyDown) +3:1212:0:96:1 //Set octave 0: Num 0 (KeyDown) +3:1213:0:97:1 //Set octave 1: Num 1 (KeyDown) +3:1214:0:98:1 //Set octave 2: Num 2 (KeyDown) +3:1215:0:99:1 //Set octave 3: Num 3 (KeyDown) 3:1216:0:52:1 //Set octave 4: 4 (KeyDown) -3:1216:0:100:1 //Set octave 4: NUM 4 (KeyDown) -3:1217:0:101:1 //Set octave 5: NUM 5 (KeyDown) -3:1218:0:102:1 //Set octave 6: NUM 6 (KeyDown) -3:1219:0:103:1 //Set octave 7: NUM 7 (KeyDown) -3:1220:0:104:1 //Set octave 8: NUM 8 (KeyDown) -3:1221:0:105:1 //Set octave 9: NUM 9 (KeyDown) -3:1316:1:16:1 //Chord Modifier: Shift (KeyDown) +3:1216:0:100:1 //Set octave 4: Num 4 (KeyDown) +3:1217:0:101:1 //Set octave 5: Num 5 (KeyDown) +3:1218:0:102:1 //Set octave 6: Num 6 (KeyDown) +3:1219:0:103:1 //Set octave 7: Num 7 (KeyDown) +3:1220:0:104:1 //Set octave 8: Num 8 (KeyDown) +3:1221:0:105:1 //Set octave 9: Num 9 (KeyDown) +3:1316:1:16:1 //Chord Modifier: Shift+Shift (KeyDown) 3:1200:0:49:1 //Note cut: 1 (KeyDown) -3:1201:0:223:1 //Note off: ` (KeyDown) +3:1201:0:223:1 //Note off: (KeyDown) 3:1201:0:187:1 //Note off: = (KeyDown) 3:1667:1:49:1 //Note cut (don't remember instrument): Shift+1 (KeyDown) -3:1668:1:223:1 //Note off (don't remember instrument): Shift+` (KeyDown) +3:1668:1:223:1 //Note off (don't remember instrument): Shift+ (KeyDown) //----( Pattern Context [bottom] - Ins Col (4) )------------ -4:1202:0:96:1 //Set instrument digit 0: NUM 0 (KeyDown) +4:1202:0:96:1 //Set instrument digit 0: Num 0 (KeyDown) 4:1202:0:48:1 //Set instrument digit 0: 0 (KeyDown) -4:1203:0:97:1 //Set instrument digit 1: NUM 1 (KeyDown) +4:1203:0:97:1 //Set instrument digit 1: Num 1 (KeyDown) 4:1203:0:49:1 //Set instrument digit 1: 1 (KeyDown) -4:1204:0:98:1 //Set instrument digit 2: NUM 2 (KeyDown) +4:1204:0:98:1 //Set instrument digit 2: Num 2 (KeyDown) 4:1204:0:50:1 //Set instrument digit 2: 2 (KeyDown) -4:1205:0:99:1 //Set instrument digit 3: NUM 3 (KeyDown) +4:1205:0:99:1 //Set instrument digit 3: Num 3 (KeyDown) 4:1205:0:51:1 //Set instrument digit 3: 3 (KeyDown) -4:1206:0:100:1 //Set instrument digit 4: NUM 4 (KeyDown) +4:1206:0:100:1 //Set instrument digit 4: Num 4 (KeyDown) 4:1206:0:52:1 //Set instrument digit 4: 4 (KeyDown) -4:1207:0:101:1 //Set instrument digit 5: NUM 5 (KeyDown) +4:1207:0:101:1 //Set instrument digit 5: Num 5 (KeyDown) 4:1207:0:53:1 //Set instrument digit 5: 5 (KeyDown) -4:1208:0:102:1 //Set instrument digit 6: NUM 6 (KeyDown) +4:1208:0:102:1 //Set instrument digit 6: Num 6 (KeyDown) 4:1208:0:54:1 //Set instrument digit 6: 6 (KeyDown) -4:1209:0:103:1 //Set instrument digit 7: NUM 7 (KeyDown) +4:1209:0:103:1 //Set instrument digit 7: Num 7 (KeyDown) 4:1209:0:55:1 //Set instrument digit 7: 7 (KeyDown) 4:1210:0:56:1 //Set instrument digit 8: 8 (KeyDown) -4:1210:0:104:1 //Set instrument digit 8: NUM 8 (KeyDown) -4:1211:0:105:1 //Set instrument digit 9: NUM 9 (KeyDown) +4:1210:0:104:1 //Set instrument digit 8: Num 8 (KeyDown) +4:1211:0:105:1 //Set instrument digit 9: Num 9 (KeyDown) 4:1211:0:57:1 //Set instrument digit 9: 9 (KeyDown) //----( Pattern Context [bottom] - Vol Col (5) )------------ 5:1222:0:48:1 //Set volume digit 0: 0 (KeyDown) -5:1222:0:96:1 //Set volume digit 0: NUM 0 (KeyDown) +5:1222:0:96:1 //Set volume digit 0: Num 0 (KeyDown) 5:1223:0:49:1 //Set volume digit 1: 1 (KeyDown) -5:1223:0:97:1 //Set volume digit 1: NUM 1 (KeyDown) +5:1223:0:97:1 //Set volume digit 1: Num 1 (KeyDown) 5:1224:0:50:1 //Set volume digit 2: 2 (KeyDown) -5:1224:0:98:1 //Set volume digit 2: NUM 2 (KeyDown) +5:1224:0:98:1 //Set volume digit 2: Num 2 (KeyDown) 5:1225:0:51:1 //Set volume digit 3: 3 (KeyDown) -5:1225:0:99:1 //Set volume digit 3: NUM 3 (KeyDown) +5:1225:0:99:1 //Set volume digit 3: Num 3 (KeyDown) 5:1226:0:52:1 //Set volume digit 4: 4 (KeyDown) -5:1226:0:100:1 //Set volume digit 4: NUM 4 (KeyDown) +5:1226:0:100:1 //Set volume digit 4: Num 4 (KeyDown) 5:1227:0:53:1 //Set volume digit 5: 5 (KeyDown) -5:1227:0:101:1 //Set volume digit 5: NUM 5 (KeyDown) +5:1227:0:101:1 //Set volume digit 5: Num 5 (KeyDown) 5:1228:0:54:1 //Set volume digit 6: 6 (KeyDown) -5:1228:0:102:1 //Set volume digit 6: NUM 6 (KeyDown) +5:1228:0:102:1 //Set volume digit 6: Num 6 (KeyDown) 5:1229:0:55:1 //Set volume digit 7: 7 (KeyDown) -5:1229:0:103:1 //Set volume digit 7: NUM 7 (KeyDown) +5:1229:0:103:1 //Set volume digit 7: Num 7 (KeyDown) 5:1230:0:56:1 //Set volume digit 8: 8 (KeyDown) -5:1230:0:104:1 //Set volume digit 8: NUM 8 (KeyDown) +5:1230:0:104:1 //Set volume digit 8: Num 8 (KeyDown) 5:1231:0:57:1 //Set volume digit 9: 9 (KeyDown) -5:1231:0:105:1 //Set volume digit 9: NUM 9 (KeyDown) +5:1231:0:105:1 //Set volume digit 9: Num 9 (KeyDown) 5:1232:0:86:1 //Vol command - volume: V (KeyDown) 5:1233:0:80:1 //Vol command - pan: P (KeyDown) 5:1234:0:67:1 //Vol command - vol slide up: C (KeyDown) @@ -216,31 +216,31 @@ 5:1246:0:79:1 //Vol command - Offset: O (KeyDown) //----( Pattern Context [bottom] - FX Col (6) )------------ -6:1294:0:220:1 //FX midi macro slide: \ (KeyDown) +6:1294:0:226:1 //FX midi macro slide: \ (KeyDown) 6:1295:1:186:1 //FX pseudo-velocity (experimental): Shift+; (KeyDown) -6:1666:0:222:1 //FX parameter extension command: # (KeyDown) +6:1666:0:222:1 //FX parameter extension command: ' (KeyDown) //----( Pattern Context [bottom] - Param Col (7) )------------ 7:1247:0:48:1 //FX Param digit 0: 0 (KeyDown) -7:1247:0:96:1 //FX Param digit 0: NUM 0 (KeyDown) +7:1247:0:96:1 //FX Param digit 0: Num 0 (KeyDown) 7:1248:0:49:1 //FX Param digit 1: 1 (KeyDown) -7:1248:0:97:1 //FX Param digit 1: NUM 1 (KeyDown) +7:1248:0:97:1 //FX Param digit 1: Num 1 (KeyDown) 7:1249:0:50:1 //FX Param digit 2: 2 (KeyDown) -7:1249:0:98:1 //FX Param digit 2: NUM 2 (KeyDown) +7:1249:0:98:1 //FX Param digit 2: Num 2 (KeyDown) 7:1250:0:51:1 //FX Param digit 3: 3 (KeyDown) -7:1250:0:99:1 //FX Param digit 3: NUM 3 (KeyDown) +7:1250:0:99:1 //FX Param digit 3: Num 3 (KeyDown) 7:1251:0:52:1 //FX Param digit 4: 4 (KeyDown) -7:1251:0:100:1 //FX Param digit 4: NUM 4 (KeyDown) +7:1251:0:100:1 //FX Param digit 4: Num 4 (KeyDown) 7:1252:0:53:1 //FX Param digit 5: 5 (KeyDown) -7:1252:0:101:1 //FX Param digit 5: NUM 5 (KeyDown) +7:1252:0:101:1 //FX Param digit 5: Num 5 (KeyDown) 7:1253:0:54:1 //FX Param digit 6: 6 (KeyDown) -7:1253:0:102:1 //FX Param digit 6: NUM 6 (KeyDown) +7:1253:0:102:1 //FX Param digit 6: Num 6 (KeyDown) 7:1254:0:55:1 //FX Param digit 7: 7 (KeyDown) -7:1254:0:103:1 //FX Param digit 7: NUM 7 (KeyDown) +7:1254:0:103:1 //FX Param digit 7: Num 7 (KeyDown) 7:1255:0:56:1 //FX Param digit 8: 8 (KeyDown) -7:1255:0:104:1 //FX Param digit 8: NUM 8 (KeyDown) +7:1255:0:104:1 //FX Param digit 8: Num 8 (KeyDown) 7:1256:0:57:1 //FX Param digit 9: 9 (KeyDown) -7:1256:0:105:1 //FX Param digit 9: NUM 9 (KeyDown) +7:1256:0:105:1 //FX Param digit 9: Num 9 (KeyDown) 7:1257:0:65:1 //FX Param digit A: A (KeyDown) 7:1258:0:66:1 //FX Param digit B: B (KeyDown) 7:1259:0:67:1 //FX Param digit C: C (KeyDown) @@ -253,13 +253,13 @@ 8:1674:4:83:1 //Save Sample: Alt+S (KeyDown) 8:1675:4:78:1 //New Sample: Alt+N (KeyDown) 8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) -8:1383:0:8:1 //Silence sample selection: BACKSPACE (KeyDown) +8:1383:0:8:1 //Silence sample selection: Backspace (KeyDown) 8:1384:3:78:1 //Normalise Sample: Shift+Ctrl+N (KeyDown) 8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) 8:1381:3:82:1 //Reverse sample: Shift+Ctrl+R (KeyDown) -8:1382:0:46:1 //Delete sample selection: DELETE (KeyDown) -8:1386:0:107:1 //Zoom Out: NUM PLUS (KeyDown) -8:1387:0:109:1 //Zoom In: NUM SUB (KeyDown) +8:1382:0:46:1 //Delete sample selection: Delete (KeyDown) +8:1386:0:107:1 //Zoom Out: Num + (KeyDown) +8:1387:0:109:1 //Zoom In: Num - (KeyDown) //----( Instrument Context [bottom] (9) )------------ Modified: trunk/OpenMPT/soundlib/LOAD_DSM.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_DSM.CPP 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/soundlib/LOAD_DSM.CPP 2007-03-13 22:14:22 UTC (rev 174) @@ -109,7 +109,7 @@ m_nDefaultTempo = psong->bpm; m_nDefaultGlobalVolume = psong->globalvol << 2; if ((!m_nDefaultGlobalVolume) || (m_nDefaultGlobalVolume > 256)) m_nDefaultGlobalVolume = 256; - m_nSongPreAmp = psong->mastervol & 0x7F; + m_nSamplePreAmp = psong->mastervol & 0x7F; for (UINT iOrd=0; iOrd<MAX_ORDERS; iOrd++) { Order[iOrd] = (BYTE)((iOrd < psong->numord) ? psong->orders[iOrd] : 0xFF); Modified: trunk/OpenMPT/soundlib/Load_far.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_far.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/soundlib/Load_far.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -76,7 +76,7 @@ m_nChannels = 16; m_nInstruments = 0; m_nSamples = 0; - m_nSongPreAmp = 0x20; + m_nSamplePreAmp = 0x20; m_nDefaultSpeed = pmh1->speed; m_nDefaultTempo = 80; m_nDefaultGlobalVolume = 256; Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -285,9 +285,9 @@ m_nDefaultGlobalVolume = id; streamPos += sizeof(DWORD); - // m_nSongPreAmp + // m_nSamplePreAmp memcpy(&id,lpStream+streamPos,sizeof(DWORD)); - m_nSongPreAmp = id; + m_nSamplePreAmp = id; streamPos += sizeof(DWORD); // m_nDefaultSpeed @@ -615,7 +615,7 @@ case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nPlugMixMode); break; case 'CWV.': fadr = reinterpret_cast<BYTE*>(&m_dwCreatedWithVersion); break; case 'LSWV': fadr = reinterpret_cast<BYTE*>(&m_dwLastSavedWithVersion); break; - case 'SPA.': fadr = reinterpret_cast<BYTE*>(&m_nSongPreAmp); break; + case 'SPA.': fadr = reinterpret_cast<BYTE*>(&m_nSamplePreAmp); break; case 'VSTV': fadr = reinterpret_cast<BYTE*>(&m_nVSTiVolume); break; case 'DGV.': fadr = reinterpret_cast<BYTE*>(&m_nDefaultGlobalVolume); break; case 'RP..': fadr = reinterpret_cast<BYTE*>(&m_nRestartPos); break; @@ -677,9 +677,9 @@ } if (pifh->speed) m_nDefaultSpeed = pifh->speed; if (pifh->tempo) m_nDefaultTempo = pifh->tempo; - m_nSongPreAmp = pifh->mv & 0x7F; - if (m_nSongPreAmp<0x20) { - m_nSongPreAmp=100; + m_nSamplePreAmp = pifh->mv & 0x7F; + if (m_nSamplePreAmp<0x20) { + m_nSamplePreAmp=100; } // Reading Channels Pan Positions for (int ipan=0; ipan</*MAX_BASECHANNELS*/64; ipan++) if (pifh->chnpan[ipan] != 0xFF) //Header only has room for settings for 64 chans... @@ -1019,7 +1019,7 @@ case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nPlugMixMode); break; case 'CWV.': fadr = reinterpret_cast<BYTE*>(&m_dwCreatedWithVersion); break; case 'LSWV': fadr = reinterpret_cast<BYTE*>(&m_dwLastSavedWithVersion); break; - case 'SPA.': fadr = reinterpret_cast<BYTE*>(&m_nSongPreAmp); break; + case 'SPA.': fadr = reinterpret_cast<BYTE*>(&m_nSamplePreAmp); break; case 'VSTV': fadr = reinterpret_cast<BYTE*>(&m_nVSTiVolume); break; case 'DGV.': fadr = reinterpret_cast<BYTE*>(&m_nDefaultGlobalVolume); break; case 'RP..': fadr = reinterpret_cast<BYTE*>(&m_nRestartPos); break; @@ -1238,7 +1238,7 @@ fwrite(&id, 1, sizeof(id), f); id = m_nDefaultGlobalVolume; fwrite(&id, 1, sizeof(id), f); - id = m_nSongPreAmp; + id = m_nSamplePreAmp; fwrite(&id, 1, sizeof(id), f); id = m_nDefaultSpeed; fwrite(&id, 1, sizeof(id), f); @@ -1502,7 +1502,7 @@ if (m_dwSongFlags & SONG_ITCOMPATMODE) header.flags |= 0x20; if (m_dwSongFlags & SONG_EXFILTERRANGE) header.flags |= 0x1000; header.globalvol = m_nDefaultGlobalVolume >> 1; - header.mv = m_nSongPreAmp; + header.mv = m_nSamplePreAmp; if (header.mv < 0x20) header.mv = 0x20; if (header.mv > 0x7F) header.mv = 0x7F; header.speed = m_nDefaultSpeed; @@ -2085,7 +2085,7 @@ if (m_dwSongFlags & SONG_ITCOMPATMODE) header.flags |= 0x20; if (m_dwSongFlags & SONG_EXFILTERRANGE) header.flags |= 0x1000; header.globalvol = m_nDefaultGlobalVolume >> 1; - header.mv = m_nSongPreAmp; + header.mv = m_nSamplePreAmp; if (header.mv < 0x20) header.mv = 0x20; if (header.mv > 0x7F) header.mv = 0x7F; header.speed = m_nDefaultSpeed; @@ -3139,11 +3139,11 @@ fwrite(&size, 1, sizeof(__int16), f); fwrite(&m_dwLastSavedWithVersion, 1, size, f); - code = 'SPA.'; //write m_nSongPreAmp + code = 'SPA.'; //write m_nSamplePreAmp fwrite(&code, 1, sizeof(__int32), f); - size = sizeof(m_nSongPreAmp); + size = sizeof(m_nSamplePreAmp); fwrite(&size, 1, sizeof(__int16), f); - fwrite(&m_nSongPreAmp, 1, size, f); + fwrite(&m_nSamplePreAmp, 1, size, f); code = 'VSTV'; //write m_nVSTiVolume fwrite(&code, 1, sizeof(__int32), f); Modified: trunk/OpenMPT/soundlib/Load_med.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/soundlib/Load_med.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -515,7 +515,7 @@ Log("\n"); #endif m_nType = MOD_TYPE_MED; - m_nSongPreAmp = 0x20; + m_nSamplePreAmp = 0x20; dwBlockArr = BigEndian(pmmh->blockarr); dwSmplArr = BigEndian(pmmh->smplarr); dwExpData = BigEndian(pmmh->expdata); Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -226,7 +226,7 @@ // Global Volume m_nDefaultGlobalVolume = psfh->globalvol << 2; if ((!m_nDefaultGlobalVolume) || (m_nDefaultGlobalVolume > 256)) m_nDefaultGlobalVolume = 256; - m_nSongPreAmp = psfh->mastervol & 0x7F; + m_nSamplePreAmp = psfh->mastervol & 0x7F; // Channels m_nChannels = 4; for (UINT ich=0; ich<32; ich++) @@ -456,7 +456,7 @@ header[0x30] = m_nDefaultGlobalVolume >> 2; header[0x31] = m_nDefaultSpeed; header[0x32] = m_nDefaultTempo; - header[0x33] = ((m_nSongPreAmp < 0x20) ? 0x20 : m_nSongPreAmp) | 0x80; // Stereo + header[0x33] = ((m_nSamplePreAmp < 0x20) ? 0x20 : m_nSamplePreAmp) | 0x80; // Stereo header[0x35] = 0xFC; for (i=0; i<32; i++) { Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -642,7 +642,7 @@ case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nPlugMixMode); break; case 'CWV.': fadr = reinterpret_cast<BYTE*>(&m_dwCreatedWithVersion); break; case 'LSWV': fadr = reinterpret_cast<BYTE*>(&m_dwLastSavedWithVersion); break; - case 'SPA.': fadr = reinterpret_cast<BYTE*>(&m_nSongPreAmp); break; + case 'SPA.': fadr = reinterpret_cast<BYTE*>(&m_nSamplePreAmp); break; case 'VSTV': fadr = reinterpret_cast<BYTE*>(&m_nVSTiVolume); break; case 'DGV.': fadr = reinterpret_cast<BYTE*>(&m_nDefaultGlobalVolume); break; } Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -2668,6 +2668,18 @@ // if (m_nInstruments) KeyOff(pChn); ? pChn->nVolume = 0; pChn->dwFlags |= CHN_FASTVOLRAMP; + + INSTRUMENTHEADER *pHeader = pChn->pHeader; + if (pHeader && pHeader->nMidiChannel>0 && pHeader->nMidiChannel<17) { // instro sends to a midi chan + UINT nPlug = pHeader->nMixPlug; + if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) { + IMixPlugin *pPlug = (IMixPlugin*)m_MixPlugins[nPlug-1].pMixPlugin; + if (pPlug) { + pPlug->MidiCommand(pHeader->nMidiChannel, pHeader->nMidiProgram, pHeader->wMidiBank, /*pChn->nNote+*/0xFF, 0, nChn); + } + } + } + } } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -178,7 +178,7 @@ RPM. [EXT] nRowsPerMeasure; RS.. nResSwing; SEP@ [EXT] chunk SEPARATOR tag -SPA. [EXT] m_nSongPreAmp; +SPA. [EXT] m_nSamplePreAmp; TM.. [EXT] nTempoMode; VE.. nVolEnv; VE[. VolEnv[MAX_ENVPOINTS]; @@ -411,7 +411,7 @@ memset(&m_SongEQ, 0, sizeof(m_SongEQ)); m_lTotalSampleCount=0; - m_nPlugMixMode=plugmix_mode_117RC2; + m_nPlugMixMode=plugmix_mode_Test; m_pConfig = new CSoundFilePlayConfig(); BuildDefaultInstrument(); @@ -438,8 +438,8 @@ m_nInstruments = 0; m_nFreqFactor = m_nTempoFactor = 128; m_nMasterVolume = 128; - m_nDefaultGlobalVolume = 128; - m_nGlobalVolume = 128; + m_nDefaultGlobalVolume = 256; + m_nGlobalVolume = 256; m_nOldGlbVolSlide = 0; m_nDefaultSpeed = 6; m_nDefaultTempo = 125; @@ -454,8 +454,8 @@ m_nRestartPos = 0; m_nMinPeriod = 16; m_nMaxPeriod = 32767; - m_nSongPreAmp = 100; - m_nVSTiVolume = 100; + m_nSamplePreAmp = 128; + m_nVSTiVolume = 128; m_nPatternNames = 0; m_nMaxOrderPosition = 0; m_lpszPatternNames = NULL; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/soundlib/Sndfile.h 2007-03-13 22:14:22 UTC (rev 174) @@ -847,7 +847,7 @@ UINT m_nPattern,m_nCurrentPattern,m_nNextPattern,m_nRestartPos, m_nSeqOverride; bool m_bPatternTransitionOccurred; UINT m_nMasterVolume, m_nGlobalVolume, m_nSamplesToGlobalVolRampDest, - m_nGlobalVolumeDestination, m_nSongPreAmp, m_nVSTiVolume; + m_nGlobalVolumeDestination, m_nSamplePreAmp, m_nVSTiVolume; long m_lHighResRampingGlobalVolume; UINT m_nFreqFactor, m_nTempoFactor, m_nOldGlbVolSlide; LONG m_nMinPeriod, m_nMaxPeriod, m_nRepeatCount; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2007-02-26 21:38:06 UTC (rev 173) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2007-03-13 22:14:22 UTC (rev 174) @@ -828,22 +828,33 @@ if(nchn32 < 1) nchn32 = 1; if(nchn32 > 31) nchn32 = 31; - int realmastervol = m_nMasterVolume; - if (realmastervol > 0x80) - { - realmastervol = 0x80 + ((realmastervol - 0x80) * (nchn32+4)) / 16; + + DWORD mastervol; + + if (m_pConfig->getUseGlobalPreAmp()) { + int realmastervol = m_nMasterVolume; + if (realmastervol > 0x80) { + //Attenuate global pre-amp depending on num channels + realmastervol = 0x80 + ((realmastervol - 0x80) * (nchn32+4)) / 16; + } + mastervol = (realmastervol * (m_nSamplePreAmp)) >> 6; + } else { + //Preferred option: don't use global pre-amp at all. + mastervol = m_nSamplePreAmp; } - DWORD mastervol = (realmastervol * (m_nSongPreAmp)) >> 6; if ((m_dwSongFlags & SONG_GLOBALFADE) && (m_nGlobalFadeMaxSamples)) { mastervol = _muldiv(mastervol, m_nGlobalFadeSamples, m_nGlobalFadeMaxSamples); } - UINT attenuation = (gdwSoundSetup & SNDMIX_AGC) ? PreAmpAGCTable[nchn32>>1] : PreAmpTable[nchn32>>1]; - if(attenuation < 1) attenuation = 1; - - nMasterVol = (mastervol << 7) / attenuation; + if (m_pConfig->getUseGlobalPreAmp()) { + UINT attenuation = (gdwSoundSetup & SNDMIX_AGC) ? PreAmpAGCTable[nchn32>>1] : PreAmpTable[nchn32>>1]; + if(attenuation < 1) attenuation = 1; + nMasterVol = (mastervol << 7) / attenuation; + } else { + nMasterVol = mastervol; + } } //////////////////////////////////////////////////////////////////////////////////// // Update channels data @@ -1459,8 +1470,7 @@ #define kChnMasterVol nMasterVol #endif // MODPLUG_TRACKER // Adjusting volumes - if (gnChannels >= 2) - { + if (gnChannels >= 2) { int pan = ((int)pChn->nRealPan) - 128; pan *= (int)m_nStereoSeparation; pan /= 128; @@ -1470,25 +1480,29 @@ #ifndef FASTSOUNDLIB if (gdwSoundSetup & SNDMIX_REVERSESTEREO) pan = 256 - pan; #endif - LONG realvol = (pChn->nRealVolume * kChnMasterVol) >> (8-1); - if (gdwSoundSetup & SNDMIX_SOFTPANNING) - { - if (pan < 128) - { + + LONG realvol; + if (m_pConfig->getUseGlobalPreAmp()) { + realvol = (pChn->nRealVolume * kChnMasterVol) >> 7; + } else { + //Extra attenuation required here if we're bypassing pre-amp. + realvol = (pChn->nRealVolume * kChnMasterVol) >> 8; + } + + if (m_pConfig->getTreatPanLikeBalance()) { + if (pan < 128) { pChn->nNewLeftVol = (realvol * pan) >> 8; pChn->nNewRightVol = (realvol * 128) >> 8; - } else - { + } else { pChn->nNewLeftVol = (realvol * 128) >> 8; pChn->nNewRightVol = (realvol * (256 - pan)) >> 8; } - } else - { + } else { pChn->nNewLeftVol = (realvol * pan) >> 8; pChn->nNewRightVol = (realvol * (256 - pan)) >> 8; } - } else - { + + } else { pChn->nNewRightVol = (pChn->nRealVolume * kChnMasterVol) >> 8; pChn->nNewLeftVol = pChn->nNewRightVol; } @@ -1544,8 +1558,11 @@ if (pChn->nInc >= 0xFE00) pChn->dwFlags |= CHN_NOIDO; #endif // FASTSOUNDLIB } - pChn->nNewRightVol >>= MIXING_ATTENUATION; - pChn->nNewLeftVol >>= MIXING_ATTENUATION; + if (m_pConfig->getUseGlobalPreAmp()) { + pChn->nNewRightVol >>= MIXING_ATTENUATION; + pChn->nNewLeftVol >>= MIXING_ATTENUATION; + } + pChn->nRightRamp = pChn->nLeftRamp = 0; // Dolby Pro-Logic Surround if ((pChn->dwFlags & CHN_SURROUND) && (gnChannels == 2)) pChn->nNewLeftVol = - pChn->nNewLeftVol; @@ -1732,7 +1749,7 @@ VOID CSoundFile::ApplyGlobalVolume(int SoundBuffer[], long lTotalSampleCount) -//-------------------------------------------------------- +//--------------------------------------------------------------------------- { long delta=0; long step=0; @@ -1754,7 +1771,6 @@ step = delta/static_cast<long>(m_nSamplesToGlobalVolRampDest); } } - for (int pos=0; pos<lTotalSampleCount; pos++) { if (m_nSamplesToGlobalVolRampDest>0) { //ramping required @@ -1767,3 +1783,4 @@ } } + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <re...@us...> - 2007-03-14 00:19:40
|
Revision: 175 http://svn.sourceforge.net/modplug/?rev=175&view=rev Author: rewbs Date: 2007-03-13 17:19:33 -0700 (Tue, 13 Mar 2007) Log Message: ----------- . v1.17.02.46 (in progress, no binary yet) First pass merge from tuning branch. Modified Paths: -------------- trunk/OpenMPT/mptrack/AutoSaver.cpp trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp trunk/OpenMPT/mptrack/ChannelManagerDlg.h trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_ins.h trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Ctrl_pat.h trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/Globals.cpp trunk/OpenMPT/mptrack/KeyConfigDlg.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/Moptions.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/PatternGotoDialog.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_pat.h trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/View_tre.h 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.vcproj trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/soundlib/Dlsbank.cpp trunk/OpenMPT/soundlib/LOAD_AMF.CPP trunk/OpenMPT/soundlib/LOAD_DBM.CPP trunk/OpenMPT/soundlib/LOAD_DMF.CPP trunk/OpenMPT/soundlib/LOAD_DSM.CPP trunk/OpenMPT/soundlib/Load_669.cpp trunk/OpenMPT/soundlib/Load_ams.cpp trunk/OpenMPT/soundlib/Load_far.cpp trunk/OpenMPT/soundlib/Load_it.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_mtm.cpp trunk/OpenMPT/soundlib/Load_okt.cpp trunk/OpenMPT/soundlib/Load_psm.cpp trunk/OpenMPT/soundlib/Load_ptm.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Load_stm.cpp trunk/OpenMPT/soundlib/Load_ult.cpp trunk/OpenMPT/soundlib/Load_wav.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Sampleio.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/Tables.cpp Added Paths: ----------- trunk/OpenMPT/mptrack/OrderToPatternTable.cpp trunk/OpenMPT/mptrack/OrderToPatternTable.h trunk/OpenMPT/mptrack/PlaybackEventer.cpp trunk/OpenMPT/mptrack/PlaybackEventer.h trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.h trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/mptrack/TuningDialog.h trunk/OpenMPT/mptrack/misc_util.cpp trunk/OpenMPT/mptrack/misc_util.h trunk/OpenMPT/mptrack/pattern.cpp trunk/OpenMPT/mptrack/pattern.h trunk/OpenMPT/mptrack/patternContainer.cpp trunk/OpenMPT/mptrack/patternContainer.h trunk/OpenMPT/mptrack/serialization_utils.cpp trunk/OpenMPT/mptrack/serialization_utils.h trunk/OpenMPT/mptrack/tuningRatioMapWnd.cpp trunk/OpenMPT/mptrack/tuningRatioMapWnd.h trunk/OpenMPT/soundlib/MPT_module.cpp trunk/OpenMPT/soundlib/MPT_module.h trunk/OpenMPT/soundlib/midi.h trunk/OpenMPT/soundlib/mod_specifications.h trunk/OpenMPT/soundlib/modcommand.h trunk/OpenMPT/soundlib/tuning.cpp trunk/OpenMPT/soundlib/tuning.h trunk/OpenMPT/soundlib/tuningCollection.cpp trunk/OpenMPT/soundlib/tuning_template.h trunk/OpenMPT/soundlib/tuningcollection.h trunk/OpenMPT/soundlib/wavConverter.h Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -206,6 +206,9 @@ name.Append(".it"); } break; + case MOD_TYPE_MPT: + name.Append(".mptm"); + break; case MOD_TYPE_XM: name.Append(".xm"); break; @@ -241,6 +244,9 @@ pSndFile->SaveITProject(fileName) : pSndFile->SaveIT(fileName, 0); break; + case MOD_TYPE_MPT: + success = pSndFile->SaveMPT(fileName, 0); + break; //default: //Do nothing } Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -181,7 +181,7 @@ EnterCriticalSection(&applying); - MODCOMMAND *p,*newp; + MODCOMMAND *p = NULL,*newp = NULL; MODCHANNELSETTINGS settings[MAX_BASECHANNELS]; UINT i,j,k,nChannels,newpat[MAX_BASECHANNELS],newMemory[4][MAX_BASECHANNELS]; @@ -199,40 +199,28 @@ BeginWaitCursor(); BEGIN_CRITICAL(); - // Rearrange patterns content - for(i = 0 ; i < MAX_PATTERNS ; i++){ + //Creating new order-vector for ReArrangeChannels. + vector<CHANNELINDEX> newChnOrder; newChnOrder.reserve(nChannels); + for(i = 0; i<nChannels; i++) + { + newChnOrder.push_back(newpat[i]); + } + if(m_pSndFile->ReArrangeChannels(newChnOrder) != nChannels) + { + MessageBox("Rearranging channels failed"); + END_CRITICAL(); + EndWaitCursor(); - // Allocate a new empty pattern to replace current pattern at i'th position in pattern array - p = m_pSndFile->Patterns[i]; - if(p) newp = CSoundFile::AllocatePattern(m_pSndFile->PatternSize[i], nChannels); + ResetState(TRUE,TRUE,TRUE,TRUE,TRUE); + LeaveCriticalSection(&applying); - if(p && !newp){ - END_CRITICAL(); - EndWaitCursor(); - LeaveCriticalSection(&applying); - ::MessageBox(NULL, "Pattern Data is corrupted!!!", "ERROR: Not enough memory to rearrange channels!", MB_ICONERROR | MB_OK); - return; - } - - // Copy data from old pattern taking care of new channel reodering - if(p != NULL){ - for(j = 0 ; j < m_pSndFile->PatternSize[i] ; j++){ - for(k = 0 ; k < nChannels ; k++) - memcpy(&newp[j*nChannels + k],&p[j*m_pSndFile->m_nChannels + newpat[k]],sizeof(MODCOMMAND)); - } - // Set new pattern in pattern array & free previous pattern - m_pSndFile->Patterns[i] = newp; - CSoundFile::FreePattern(p); - } + return; } + - // Copy channel settings - for(i = 0 ; i < m_pSndFile->m_nChannels ; i++) settings[i] = m_pSndFile->ChnSettings[i]; - // Redistribute channel setting & update manager internal store memory for(i = 0 ; i < nChannels ; i++){ if(i != newpat[i]){ - m_pSndFile->ChnSettings[i] = settings[newpat[i]]; memory[0][i] = newMemory[0][newpat[i]]; memory[1][i] = newMemory[1][newpat[i]]; memory[2][i] = newMemory[2][newpat[i]]; @@ -240,23 +228,13 @@ memory[3][i] = i; } - // Also update record states (unfortunetely they are not part of channel settings) - for(i = 0 ; i < nChannels ; i++) newMemory[1][i] = pModDoc->IsChannelRecord(i); - - pModDoc->ReinitRecordState(); - for(i = 0 ; i < nChannels ; i++){ - if(newMemory[1][newpat[i]] == 1) pModDoc->Record1Channel(i,TRUE); - if(newMemory[1][newpat[i]] == 2) pModDoc->Record2Channel(i,TRUE); - } - - // Update new number of channels - m_pSndFile->m_nChannels = nChannels; if(pActiveMod == pModDoc){ i = m_pSndFile->GetCurrentPos(); m_pSndFile->m_dwSongFlags &= ~SONG_STEP; m_pSndFile->SetCurrentPos(0); m_pSndFile->SetCurrentPos(i); } + END_CRITICAL(); EndWaitCursor(); Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.h =================================================================== --- trunk/OpenMPT/mptrack/ChannelManagerDlg.h 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/ChannelManagerDlg.h 2007-03-14 00:19:33 UTC (rev 175) @@ -12,6 +12,7 @@ public: static CChannelManagerDlg * sharedInstance(BOOL autoCreate = TRUE); + static void DestroySharedInstance() {delete sharedInstance_; sharedInstance_ = NULL;} void SetDocument(void * parent); BOOL IsOwner(void * ctrl); BOOL IsDisplayed(void); Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -2258,6 +2258,16 @@ commands[kcFileExportCompat].isHidden = false; commands[kcFileExportCompat].isDummy = false; + commands[kcUnmuteAllChnOnPatTransition].UID = 1778; + commands[kcUnmuteAllChnOnPatTransition].isHidden = false; + commands[kcUnmuteAllChnOnPatTransition].isDummy = false; + commands[kcUnmuteAllChnOnPatTransition].Message = "Unmute all channels on pattern transition"; + + commands[kcSoloChnOnPatTransition].UID = 1779; + commands[kcSoloChnOnPatTransition].isHidden = false; + commands[kcSoloChnOnPatTransition].isDummy = false; + commands[kcSoloChnOnPatTransition].Message = "Solo channel on pattern transition"; + #ifdef _DEBUG for (int i=0; i<kcNumCommands; i++) { if (commands[i].UID != 0) { // ignore unset UIDs Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/CommandSet.h 2007-03-14 00:19:33 UTC (rev 175) @@ -226,6 +226,8 @@ kcChannelSolo, kcChannelUnmuteAll, kcToggleChanMuteOnPatTransition, + kcUnmuteAllChnOnPatTransition, + kcSoloChnOnPatTransition, kcCopyAndLoseSelection, kcTransposeUp, kcTransposeDown, Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -159,7 +159,7 @@ { // Detecting max valid restart position UINT i = 0; - for (i=0; i<MAX_ORDERS; i++) if (m_pSndFile->Order[i] == 0xFF) break; + for (i=0; i<m_pSndFile->Order.size(); i++) if (m_pSndFile->Order[i] == m_pSndFile->Patterns.GetInvalidIndex()) break; m_SpinRestartPos.SetRange(0, i); } if (dwHint & HINT_MODGENERAL) @@ -217,6 +217,8 @@ // -> DESC="IT project files (.itp)" // case MOD_TYPE_IT: pszModType = "IT (Impulse Tracker)"; break; case MOD_TYPE_IT: pszModType = m_pSndFile->m_dwSongFlags & SONG_ITPROJECT ? "ITP (IT Project)" : "IT (Impulse Tracker)"; break; + case MOD_TYPE_MPT: pszModType = "MPTM (OpenMPT)"; break; + // -! NEW_FEATURE#0023 } wsprintf(s, "%s, %d channels", pszModType, m_pSndFile->m_nChannels); @@ -446,9 +448,9 @@ if (s[0]) { UINT n = atoi(s); - if (n < MAX_ORDERS) + if(n < m_pSndFile->Order.size()) { - for (UINT i=0; i<=n; i++) if (m_pSndFile->Order[i] == 0xFF) return; + for (UINT i=0; i<=n; i++) if (m_pSndFile->Order[i] == m_pSndFile->Patterns.GetInvalidIndex()) return; if (n != m_pSndFile->m_nRestartPos) { m_EditRestartPos.SetModify(FALSE); Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -7,6 +7,7 @@ #include "ctrl_ins.h" #include "view_ins.h" #include "dlg_misc.h" +#include "tuningDialog.h" #include "misc_util.h" #include <vector> #include <string> @@ -15,6 +16,8 @@ #pragma warning(disable:4244) +const pair<string, WORD> CCtrlInstruments::s_TuningNotFound("Tuning was not found. Setting to default tuning", 7); + ///////////////////////////////////////////////////////////////////////// // CNoteMapWnd @@ -160,7 +163,10 @@ // Note s[0] = 0; - if ((nPos >= 0) && (nPos < 120)) wsprintf(s, "%s%d", szNoteNames[nPos % 12], nPos/12); + + string temp = pSndFile->GetNoteName(nPos+1, m_nInstrument); + temp.resize(4); + if ((nPos >= 0) && (nPos < 120)) wsprintf(s, "%s", temp.c_str()); rect.SetRect(0, ypaint, m_cxFont, ypaint+m_cyFont); DrawButtonRect(hdc, &rect, s, FALSE, FALSE); // Mapped Note @@ -173,7 +179,12 @@ UINT n = penv->NoteMap[nPos]; if (n == 0xFF) strcpy(s, "==="); else if (n == 0xFE) strcpy(s, "^^^"); else - if (n <= 120) wsprintf(s, "%s%d", szNoteNames[(n-1)%12], (n-1)/12); + if (n <= 120) + { + string temp = pSndFile->GetNoteName(n, m_nInstrument); + temp.resize(4); + wsprintf(s, "%s", temp.c_str()); + } } FillRect(hdc, &rect, (bHighLight) ? CMainFrame::brushHighLight : CMainFrame::brushWindow); if ((nPos == (int)m_nNote) && (!m_bIns)) @@ -439,7 +450,7 @@ INSTRUMENTHEADER *penv = pSndFile->Headers[m_nInstrument]; if ((penv) && (m_nNote < 120)) { - if (!m_bIns && (pSndFile->m_nType & MOD_TYPE_IT)) + if (!m_bIns && (pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) { UINT n = penv->NoteMap[m_nNote]; BOOL bOk = FALSE; @@ -496,7 +507,7 @@ return true; } - else if ((!m_bIns) && (pSndFile->m_nType & MOD_TYPE_IT)) { //in note column + else if ((!m_bIns) && (pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT))) { //in note column UINT n = penv->NoteMap[m_nNote]; @@ -649,6 +660,7 @@ ON_CBN_SELCHANGE(IDC_FILTERMODE, OnFilterModeChanged) ON_COMMAND(ID_INSTRUMENT_SAMPLEMAP, OnEditSampleMap) //}}AFX_MSG_MAP + ON_CBN_SELCHANGE(IDC_COMBOTUNING, OnCbnSelchangeCombotuning) ON_EN_CHANGE(IDC_EDIT_PITCHTEMPOLOCK, OnEnChangeEditPitchtempolock) ON_BN_CLICKED(IDC_CHECK_PITCHTEMPOLOCK, OnBnClickedCheckPitchtempolock) ON_EN_KILLFOCUS(IDC_EDIT_PITCHTEMPOLOCK, OnEnKillfocusEditPitchtempolock) @@ -696,6 +708,7 @@ DDX_Control(pDX, IDC_SLIDER5, m_SliderAttack); DDX_Control(pDX, IDC_SPIN1, m_SpinAttack); // -! NEW_FEATURE#0027 + DDX_Control(pDX, IDC_COMBOTUNING, m_ComboTuning); DDX_Control(pDX, IDC_CHECK_PITCHTEMPOLOCK, m_CheckPitchTempoLock); DDX_Control(pDX, IDC_EDIT_PITCHTEMPOLOCK, m_EditPitchTempoLock); //}}AFX_DATA_MAP @@ -815,12 +828,12 @@ m_SpinInstrument.SetFocus(); + BuildTuningComboBox(); + CheckDlgButton(IDC_CHECK_PITCHTEMPOLOCK, MF_UNCHECKED); - //OnBnClickedCheckPitchtempolock(); + OnBnClickedCheckPitchtempolock(); m_EditPitchTempoLock.SetLimitText(4); - - return FALSE; } @@ -864,6 +877,7 @@ } PostViewMessage(VIEWMSG_SETCURRENTINSTRUMENT, m_nInstrument); UnlockControls(); + return TRUE; } @@ -1010,9 +1024,10 @@ if (!m_bInitialized) dwHintMask |= HINT_MODTYPE; if (dwHintMask & HINT_MODTYPE) { - BOOL bITonly = ((m_pSndFile->m_nType == MOD_TYPE_IT) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; + BOOL bITonly = ((m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; //rewbs.instroVSTi - BOOL bITandXM = (((m_pSndFile->m_nType == MOD_TYPE_IT) || (m_pSndFile->m_nType == MOD_TYPE_XM)) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; + BOOL bITandXM = (((m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) || (m_pSndFile->m_nType == MOD_TYPE_XM)) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; + bool bMPTOnly = ((m_pSndFile->m_nType == MOD_TYPE_MPT) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT10), bITandXM); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT11), bITandXM); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT7), bITandXM); @@ -1052,8 +1067,9 @@ m_SliderResonance.EnableWindow(bITonly); m_SpinInstrument.SetRange(1, m_pSndFile->m_nInstruments); m_SpinInstrument.EnableWindow((m_pSndFile->m_nInstruments) ? TRUE : FALSE); - m_EditPitchTempoLock.EnableWindow(bITonly); - m_CheckPitchTempoLock.EnableWindow(bITonly); + m_ComboTuning.EnableWindow(bMPTOnly); + m_EditPitchTempoLock.EnableWindow(bMPTOnly); + m_CheckPitchTempoLock.EnableWindow(bMPTOnly); } if (dwHintMask & (HINT_INSTRUMENT|HINT_MODTYPE)) { @@ -1124,7 +1140,7 @@ m_ComboPPC.SetCurSel(penv->nPPC); SetDlgItemInt(IDC_EDIT15, penv->nPPS); // Filter - if (m_pSndFile->m_nType & MOD_TYPE_IT) + if (m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) { m_CheckCutOff.SetCheck((penv->nIFC & 0x80) ? TRUE : FALSE); m_CheckResonance.SetCheck((penv->nIFR & 0x80) ? TRUE : FALSE); @@ -1145,6 +1161,8 @@ if(n == 0) SetDlgItemText(IDC_EDIT2,"default"); else SetDlgItemInt(IDC_EDIT2,n); // -! NEW_FEATURE#0027 + + UpdateTuningComboBox(); if(penv->wPitchToTempoLock > 0) //Current instrument uses pitchTempoLock. CheckDlgButton(IDC_CHECK_PITCHTEMPOLOCK, MF_CHECKED); else @@ -1323,7 +1341,7 @@ BOOL CCtrlInstruments::GetToolTipText(UINT uId, LPSTR pszText) //------------------------------------------------------------ { - //NOTE: pszText seems to point to char array of length 256. + //NOTE: pszText seems to point to char array of length 256 (Noverber 2006). if ((pszText) && (uId)) { switch(uId) @@ -1340,8 +1358,8 @@ case IDC_CHECK_PITCHTEMPOLOCK: if ((m_pSndFile) && (m_pSndFile->Headers[m_nInstrument])) { - const string str = string("Tempo range: ") + Stringify(m_pSndFile->GetTempoMin()) + string(" - ") + Stringify(m_pSndFile->GetTempoMax()); - ASSERT(str.size() < 256); + string str = string("Tempo range: ") + Stringify(m_pSndFile->GetTempoMin()) + string(" - ") + Stringify(m_pSndFile->GetTempoMax()); + if(str.size() >= 250) str.resize(250); wsprintf(pszText, str.c_str()); return TRUE; } @@ -1411,7 +1429,7 @@ if (m_pModDoc) { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - if ((pSndFile->m_nType & MOD_TYPE_IT) + if ((pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (pSndFile->m_nInstruments > 0) && (CMainFrame::GetInputHandler()->ShiftPressed())) //rewbs.customKeys { @@ -1438,7 +1456,7 @@ if (m_pModDoc) { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - if ((pSndFile->m_nType & MOD_TYPE_IT) && (pSndFile->m_nInstruments > 0)) + if ((pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (pSndFile->m_nInstruments > 0)) { BOOL bFirst = (pSndFile->m_nInstruments) ? FALSE : TRUE; LONG smp = m_pModDoc->InsertInstrument(0, m_nInstrument); @@ -1461,7 +1479,7 @@ CFileDialog dlg(TRUE, NULL, NULL, - OFN_HIDEREADONLY | OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST, + OFN_HIDEREADONLY | OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_ALLOWMULTISELECT, "All Instruments|*.xi;*.pat;*.iti;*.wav;*.aif;*.aiff|" "FastTracker II Instruments (*.xi)|*.xi|" "GF1 Patches (*.pat)|*.pat|" @@ -1472,8 +1490,36 @@ { dlg.m_ofn.lpstrInitialDir = CMainFrame::m_szCurInsDir; } + const size_t bufferSize = 2048; //Note: This is possibly the maximum buffer size. + vector<char> filenameBuffer(bufferSize, 0); + dlg.GetOFN().lpstrFile = &filenameBuffer[0]; + dlg.GetOFN().nMaxFile = bufferSize; + if (dlg.DoModal() != IDOK) return; - if (!OpenInstrument(dlg.GetPathName())) ErrorBox(IDS_ERR_FILEOPEN, this); + + POSITION pos = dlg.GetStartPosition(); + size_t counter = 0; + while(pos != NULL) + { + //If loading multiple instruments, advancing to next instrument and creating + //new instrument if necessary. + if(counter > 0) + { + if(m_nInstrument >= MAX_INSTRUMENTS-1) + break; + else + m_nInstrument++; + + if(m_nInstrument > m_pSndFile->GetNumInstruments()) + OnInstrumentNew(); + } + + if(!OpenInstrument(dlg.GetNextPathName(pos))) + ErrorBox(IDS_ERR_FILEOPEN, this); + + counter++; + } + filenameBuffer.clear(); if (m_pParent) m_pParent->InstrumentChanged(m_nInstrument); SwitchToView(); } @@ -1503,10 +1549,10 @@ // "FastTracker II Instruments (*.xi)|*.xi|" // "Impulse Tracker Instruments (*.iti)|*.iti||", // this); - CFileDialog dlg(FALSE, (m_pSndFile->m_nType & MOD_TYPE_IT) ? "iti" : "xi", + CFileDialog dlg(FALSE, (m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) ? "iti" : "xi", szFileName, OFN_HIDEREADONLY| OFN_ENABLESIZING | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_NOREADONLYRETURN, - ( m_pSndFile->m_nType & MOD_TYPE_IT ? "Impulse Tracker Instruments (*.iti)|*.iti|" + ( m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT) ? "Impulse Tracker Instruments (*.iti)|*.iti|" "FastTracker II Instruments (*.xi)|*.xi||" : "FastTracker II Instruments (*.xi)|*.xi|" "Impulse Tracker Instruments (*.iti)|*.iti||" ), @@ -1649,7 +1695,7 @@ if (nVol != (int)penv->nGlobalVol) { penv->nGlobalVol = nVol; - if (m_pSndFile->m_nType == MOD_TYPE_IT) m_pModDoc->SetModified(); + if (m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) m_pModDoc->SetModified(); // -> CODE#0023 // -> DESC="IT project files (.itp)" m_pSndFile->instrumentModified[m_nInstrument-1] = TRUE; @@ -1691,7 +1737,7 @@ if (nPan != (int)penv->nPan) { penv->nPan = nPan; - if (m_pSndFile->m_nType == MOD_TYPE_IT) m_pModDoc->SetModified(); + if (m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) m_pModDoc->SetModified(); // -> CODE#0023 // -> DESC="IT project files (.itp)" m_pSndFile->instrumentModified[m_nInstrument-1] = TRUE; @@ -2362,7 +2408,134 @@ return 0; } + //end rewbs.customKeys + +void CCtrlInstruments::OnCbnSelchangeCombotuning() +//------------------------------------------------ +{ + if (IsLocked() || m_pModDoc == NULL || m_pSndFile == NULL) return; + + INSTRUMENTHEADER* pInstH = m_pSndFile->Headers[m_nInstrument]; + if(pInstH == 0) + return; + + size_t sel = m_ComboTuning.GetCurSel(); + if(sel == 0) //Setting IT behavior + { + BEGIN_CRITICAL(); + pInstH->SetTuning(NULL); + END_CRITICAL(); + m_pModDoc->SetModified(); + UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT); + return; + } + + sel -= 1; + CTuningCollection* tc = 0; + + if(sel < CSoundFile::s_TuningsSharedStandard.GetNumTunings()) + tc = &CSoundFile::s_TuningsSharedStandard; + else + { + sel -= CSoundFile::s_TuningsSharedStandard.GetNumTunings(); + if(sel < CSoundFile::s_TuningsSharedLocal.GetNumTunings()) + tc = &CSoundFile::s_TuningsSharedLocal; + else + { + sel -= CSoundFile::s_TuningsSharedLocal.GetNumTunings(); + if(sel < m_pSndFile->m_TuningsTuneSpecific.GetNumTunings()) + tc = &m_pSndFile->m_TuningsTuneSpecific; + } + } + + if(tc) + { + BEGIN_CRITICAL(); + pInstH->SetTuning(&tc->GetTuning(sel)); + END_CRITICAL(); + m_pModDoc->SetModified(); + UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT); + return; + } + + //Case: Chosen tuning editor to be displayed. + //Creating vector for the CTuningDialog. + vector<CTuningCollection*> v; + v.push_back(&m_pSndFile->s_TuningsSharedStandard); + v.push_back(&m_pSndFile->s_TuningsSharedLocal); + v.push_back(&m_pSndFile->m_TuningsTuneSpecific); + CTuningDialog td(this, v, pInstH->pTuning); + td.DoModal(); + if(td.GetModifiedStatus(&m_pSndFile->s_TuningsSharedLocal)) + { + if(MsgBox(IDS_APPLY_TUNING_MODIFICATIONS, this, "", MB_OKCANCEL) == IDOK) + m_pSndFile->SaveStaticTunings(); + } + if(td.GetModifiedStatus(&m_pSndFile->m_TuningsTuneSpecific)) + { + m_pModDoc->SetModified(); + } + + //Recreating tuning combobox so that possible + //new tuning(s) come visible. + BuildTuningComboBox(); + + UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT); +} + + +void CCtrlInstruments::UpdateTuningComboBox() +//------------------------------------------- +{ + if (m_pModDoc == 0 || m_pSndFile == 0 + || m_nInstrument > m_pSndFile->GetNumInstruments() + || m_pSndFile->Headers[m_nInstrument] == NULL) return; + + INSTRUMENTHEADER* const penv = m_pSndFile->Headers[m_nInstrument]; + if(penv->pTuning == NULL) + { + m_ComboTuning.SetCurSel(0); + return; + } + + for(size_t i = 0; i < CSoundFile::s_TuningsSharedStandard.GetNumTunings(); i++) + { + if(penv->pTuning == &CSoundFile::s_TuningsSharedStandard.GetTuning(i)) + { + m_ComboTuning.SetCurSel(i+1); + return; + } + } + + for(size_t i = 0; i < CSoundFile::s_TuningsSharedLocal.GetNumTunings(); i++) + { + if(penv->pTuning == &CSoundFile::s_TuningsSharedLocal.GetTuning(i)) + { + m_ComboTuning.SetCurSel(i+CSoundFile::s_TuningsSharedStandard.GetNumTunings()+1); + return; + } + } + + for(size_t i = 0; i < m_pSndFile->m_TuningsTuneSpecific.GetNumTunings(); i++) + { + if(penv->pTuning == &m_pSndFile->m_TuningsTuneSpecific.GetTuning(i)) + { + m_ComboTuning.SetCurSel(i+CSoundFile::s_TuningsSharedStandard.GetNumTunings() + CSoundFile::s_TuningsSharedLocal.GetNumTunings()+1); + return; + } + } + + string str = s_TuningNotFound.first; + str.insert(s_TuningNotFound.second, m_pSndFile->Headers[m_nInstrument]->pTuning->GetName()); + MessageBox(str.c_str()); + BEGIN_CRITICAL(); + penv->SetTuning(penv->s_DefaultTuning); + END_CRITICAL(); + m_pModDoc->SetModified(); + UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT); +} + void CCtrlInstruments::OnEnChangeEditPitchtempolock() //---------------------------------------------------- { @@ -2397,7 +2570,7 @@ if(!penv) return; - //Checking to what value to put for the wPitchToTempoLock. + //Checking what value to put for the wPitchToTempoLock. m_EditPitchTempoLock.EnableWindow(); WORD ptl = penv->wPitchToTempoLock; if(ptl == 0) @@ -2412,7 +2585,7 @@ ptl = m_pSndFile->m_nDefaultTempo; } m_EditPitchTempoLock.SetWindowText(Stringify(ptl).c_str()); - //SetModified() comes with this. + //SetModified() comes with SetWindowText(.). } else { @@ -2428,9 +2601,12 @@ } } + void CCtrlInstruments::OnEnKillfocusEditPitchtempolock() //------------------------------------------------------ { + //Checking that tempo value is in correct range. + if(!m_pSndFile || IsLocked()) return; char buffer[6]; @@ -2438,7 +2614,6 @@ int ptlTempo = atoi(buffer); bool changed = false; - if(ptlTempo < m_pSndFile->GetTempoMin()) { ptlTempo = m_pSndFile->GetTempoMin(); @@ -2450,6 +2625,29 @@ changed = true; } - if(changed) m_EditPitchTempoLock.SetWindowText(Stringify(ptlTempo).c_str()); } + + +void CCtrlInstruments::BuildTuningComboBox() +//------------------------------------------ +{ + while(m_ComboTuning.GetCount() > 0) + m_ComboTuning.DeleteString(0); + + m_ComboTuning.AddString("OMPT IT behavior"); //<-> Instrument pTuning pointer == NULL + for(size_t i = 0; i<CSoundFile::s_TuningsSharedStandard.GetNumTunings(); i++) + { + m_ComboTuning.AddString(CSoundFile::s_TuningsSharedStandard.GetTuning(i).GetName().c_str()); + } + for(size_t i = 0; i<CSoundFile::s_TuningsSharedLocal.GetNumTunings(); i++) + { + m_ComboTuning.AddString(CSoundFile::s_TuningsSharedLocal.GetTuning(i).GetName().c_str()); + } + for(size_t i = 0; i<m_pSndFile->m_TuningsTuneSpecific.GetNumTunings(); i++) + { + m_ComboTuning.AddString(m_pSndFile->m_TuningsTuneSpecific.GetTuning(i).GetName().c_str()); + } + m_ComboTuning.AddString("Control tunings..."); + m_ComboTuning.SetCurSel(0); +} Modified: trunk/OpenMPT/mptrack/Ctrl_ins.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.h 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/Ctrl_ins.h 2007-03-14 00:19:33 UTC (rev 175) @@ -78,10 +78,18 @@ CSpinButtonCtrl m_SpinAttack; // -! NEW_FEATURE#0027 + //Tuning + CComboBox m_ComboTuning; + void UpdateTuningComboBox(); + void BuildTuningComboBox(); + static const pair<string, WORD> s_TuningNotFound; + //first <-> string, second <-> place where to put tuning name. + //Pitch/Tempo lock CEdit m_EditPitchTempoLock; CButton m_CheckPitchTempoLock; + public: CCtrlInstruments(); virtual ~CCtrlInstruments(); @@ -94,6 +102,8 @@ VOID UpdateFilterText(); LONG* GetSplitPosRef() {return &CMainFrame::glInstrumentWindowHeight;} //rewbs.varWindowSize + + public: //{{AFX_VIRTUAL(CCtrlInstruments) virtual BOOL OnInitDialog(); @@ -148,6 +158,7 @@ afx_msg void OnEditSampleMap(); afx_msg void TogglePluginEditor(); //rewbs.instroVSTi afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys + afx_msg void OnCbnSelchangeCombotuning(); afx_msg void OnEnChangeEditPitchtempolock(); afx_msg void OnBnClickedCheckPitchtempolock(); afx_msg void OnEnKillfocusEditPitchtempolock(); Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -166,10 +166,13 @@ // Spin controls m_SpinSpacing.SetRange(0, 16); m_SpinSpacing.SetPos(CMainFrame::gnPatternSpacing); + m_SpinInstrument.SetRange(-1, 1); m_SpinInstrument.SetPos(0); + m_SpinOrderListMargins.SetRange(0, m_OrderList.GetShownOrdersMax()); m_SpinOrderListMargins.SetPos(m_OrderList.GetOrderlistMargins()); + SetDlgItemInt(IDC_EDIT_SPACING, CMainFrame::gnPatternSpacing); SetDlgItemInt(IDC_EDIT_ORDERLIST_MARGINS, m_OrderList.GetOrderlistMargins()); CheckDlgButton(IDC_PATTERN_FOLLOWSONG, !(CMainFrame::m_dwPatternSetup & PATTERN_FOLLOWSONGOFF)); //rewbs.noFollow - set to unchecked @@ -178,6 +181,8 @@ UpdateView(HINT_MODTYPE|HINT_PATNAMES, NULL); RecalcLayout(); + + // -> CODE#0012 // -> DESC="midi keyboard split" //rewbs.merge: fix buffer overrun: @@ -222,6 +227,7 @@ m_bInitialized = TRUE; UnlockControls(); + return FALSE; } @@ -338,7 +344,7 @@ } m_pSndFile->GetPatternName(nPat, s, sizeof(s)); m_EditPatName.SetWindowText(s); - BOOL bXMIT = (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT)) ? TRUE : FALSE; + BOOL bXMIT = (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE; m_ToolBar.EnableButton(ID_PATTERN_MIDIMACRO, bXMIT); m_ToolBar.EnableButton(ID_PATTERN_PROPERTIES, bXMIT); m_ToolBar.EnableButton(ID_PATTERN_EXPAND, bXMIT); @@ -550,6 +556,7 @@ //----------------------------------------------- { CModDoc *pModDoc = GetDocument(); + CSoundFile* pSndFile = pModDoc ? pModDoc->GetSoundFile() : NULL; if ((pModDoc) && (m_pParent)) { @@ -560,28 +567,26 @@ } m_pParent->InstrumentChanged(-1); } - if ((lParam >= 0) && (lParam < MAX_PATTERNS)) + if ((lParam >= 0) && (lParam < m_pSndFile->Patterns.Size())) { - if (pModDoc) + if (pSndFile) { - CSoundFile *pSndFile = pModDoc->GetSoundFile(); - for (UINT i=0; i<MAX_ORDERS; i++) + for (UINT i=0; i<pSndFile->Order.size(); i++) { if (pSndFile->Order[i] == (UINT)lParam) { m_OrderList.SetCurSel(i, TRUE); break; } - if (pSndFile->Order[i] == 0xFF) break; + if (pSndFile->Order[i] == pSndFile->Patterns.GetInvalidIndex()) break; } } SetCurrentPattern(lParam); } - else if ((lParam >= 0x8000) && (lParam < MAX_ORDERS + 0x8000)) + else if ((lParam >= 0x8000) && (lParam < pSndFile->Order.size() + 0x8000)) { - if (pModDoc) + if (pSndFile) { - CSoundFile *pSndFile = pModDoc->GetSoundFile(); lParam &= 0x7FFF; m_OrderList.SetCurSel(lParam); SetCurrentPattern(pSndFile->Order[lParam]); @@ -693,6 +698,8 @@ SetDlgItemInt(IDC_EDIT_ORDERLIST_MARGINS, i); } + + void CCtrlPatterns::OnSpacingChanged() //------------------------------------ { @@ -822,13 +829,13 @@ UINT nCurOrd = m_OrderList.GetCurSel(); UINT pat = pSndFile->Order[nCurOrd]; UINT rows = 64; - if ((pat < MAX_PATTERNS) && (pSndFile->Patterns[pat]) && (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT))) + if ((pat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[pat]) && (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT))) { rows = pSndFile->PatternSize[pat]; if (rows < 32) rows = 32; } LONG nNewPat = m_pModDoc->InsertPattern(nCurOrd+1, rows); - if ((nNewPat >= 0) && (nNewPat < MAX_PATTERNS)) + if ((nNewPat >= 0) && (nNewPat < pSndFile->Patterns.Size())) { m_OrderList.SetCurSel(nCurOrd+1); m_OrderList.InvalidateRect(NULL, FALSE); @@ -850,15 +857,15 @@ UINT nCurOrd = m_OrderList.GetCurSel(); UINT nCurPat = pSndFile->Order[nCurOrd]; UINT rows = 64; - if (nCurPat < MAX_PATTERNS) + if (nCurPat < pSndFile->Patterns.Size()) { - if ((pSndFile->Patterns[nCurPat]) && (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT))) + if ((pSndFile->Patterns[nCurPat]) && (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT))) { rows = pSndFile->PatternSize[nCurPat]; if (rows < 16) rows = 16; } LONG nNewPat = m_pModDoc->InsertPattern(nCurOrd+1, rows); - if ((nNewPat >= 0) && (nNewPat < MAX_PATTERNS)) + if ((nNewPat >= 0) && (nNewPat < pSndFile->Patterns.Size())) { MODCOMMAND *pSrc = pSndFile->Patterns[nCurPat]; MODCOMMAND *pDest = pSndFile->Patterns[nNewPat]; @@ -1074,7 +1081,7 @@ if (strcmp(s, sold)) { m_pSndFile->SetPatternName(nPat, s); - if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT)) m_pModDoc->SetModified(); + if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified(); m_pModDoc->UpdateAllViews(NULL, (nPat << 24) | HINT_PATNAMES, this); } } @@ -1204,4 +1211,5 @@ return false; } + //end rewbs.instroVST \ No newline at end of file Modified: trunk/OpenMPT/mptrack/Ctrl_pat.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.h 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/Ctrl_pat.h 2007-03-14 00:19:33 UTC (rev 175) @@ -37,10 +37,14 @@ BOOL UpdateScrollInfo(); void UpdateInfoText(); int GetFontWidth(); - BYTE SetOrderlistMargins(int); //Returns the number that was set. + + //Returns the number that was set. + BYTE SetOrderlistMargins(int); BYTE GetOrderlistMargins() const {return m_nOrderlistMargins;} - BYTE GetShownOrdersMax(); //Should return the maximum number of shown orders. + //Should return the maximum number of shown orders. + BYTE GetShownOrdersMax(); + public: //{{AFX_VIRTUAL(COrderList) virtual BOOL PreTranslateMessage(MSG *pMsg); Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -105,7 +105,7 @@ UINT nPage; int nMax=0; - while ((nMax < MAX_ORDERS) && (pSndFile->Order[nMax] != 0xFF)) nMax++; + while ((nMax < pSndFile->Order.size()) && (pSndFile->Order[nMax] != pSndFile->Patterns.GetInvalidIndex())) nMax++; GetScrollInfo(SB_HORZ, &info, SIF_PAGE|SIF_RANGE); info.fMask = SIF_PAGE|SIF_RANGE; info.nMin = 0; @@ -166,9 +166,10 @@ //--------------------------------------------- { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); + CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); CRect rcClient; - if ((sel < 0) || (sel >= MAX_ORDERS) || (!m_pParent) || (!pMainFrm)) return FALSE; + if ((sel < 0) || (sel >= pSndFile->Order.size()) || (!m_pParent) || (!pMainFrm)) return FALSE; if (sel == m_nScrollPos) return TRUE; GetClientRect(&rcClient); InvalidateSelection(); @@ -195,9 +196,8 @@ InvalidateSelection(); if ((m_pParent) && (m_pModDoc) && (bEdit)) { - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); UINT n = pSndFile->Order[m_nScrollPos]; - if ((n < MAX_PATTERNS) && (pSndFile->Patterns[n])) + if ((n < pSndFile->Patterns.Size()) && (pSndFile->Patterns[n])) { BOOL bIsPlaying = (pMainFrm->GetModPlaying() == m_pModDoc); if ((bIsPlaying) && (pSndFile->m_dwSongFlags & SONG_PATTERNLOOP)) @@ -216,7 +216,11 @@ pSndFile->m_nCurrentPattern = m_nScrollPos; pSndFile->SetCurrentOrder(m_nScrollPos); pSndFile->m_dwSongFlags |= dwPaused; - if (!(dwPaused & SONG_PATTERNLOOP)) pSndFile->GetLength(TRUE); + //if (!(dwPaused & SONG_PATTERNLOOP)) pSndFile->GetLength(TRUE); + //Relabs.note: Commented above line for it seems to cause + //significant slowdown when changing patterns without + //pattern-loop enabled. What is it's purpose anyway? + if (bIsPlaying) pMainFrm->ResetNotificationBuffer(); END_CRITICAL(); } @@ -231,9 +235,9 @@ UINT COrderList::GetCurrentPattern() const //---------------------------------------- { - if ((m_pModDoc) && (m_nScrollPos < MAX_PATTERNS)) + CSoundFile* pSndFile = m_pModDoc ? m_pModDoc->GetSoundFile() : NULL; + if ((pSndFile) && (m_nScrollPos < pSndFile->Patterns.Size())) { - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); return pSndFile->Order[m_nScrollPos]; } return 0; @@ -255,7 +259,7 @@ { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); int i = 0; - for (i=0; i<MAX_ORDERS-1; i++) if (pSndFile->Order[i+1] == 0xFF) break; + for (i=0; i<pSndFile->Order.size()-1; i++) if (pSndFile->Order[i+1] == pSndFile->Patterns.GetInvalidIndex()) break; SetCurSel(i); } break; @@ -288,10 +292,11 @@ CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); int ord = pSndFile->Order[m_nScrollPos]; int maxpat = 0; - for (int i=0; i<MAX_PATTERNS; i++) if (pSndFile->Patterns[i]) maxpat = i; + for (int i=0; i<pSndFile->Patterns.Size(); i++) if (pSndFile->Patterns[i]) maxpat = i; if ((nChar >= '0') && (nChar <= '9')) { - if (ord >= MAX_PATTERNS) ord = 0; + if (ord >= pSndFile->Patterns.Size()) ord = 0; + ord = ord * 10 + (nChar - '0'); if ((ord >= 100) && (ord > maxpat)) ord %= 100; if ((ord >= 10) && (ord > maxpat)) ord %= 10; @@ -299,18 +304,23 @@ if (nChar == '+') { ord++; - if (ord > 0xFF) ord = 0; else - if ((ord > maxpat) && (ord < 0xFE)) ord = 0xFE; + if(ord > pSndFile->Patterns.GetInvalidIndex()) + ord = 0; + else + { + if(ord > maxpat && ord < pSndFile->Patterns.GetIgnoreIndex()) + ord = pSndFile->Patterns.GetIgnoreIndex(); + } } else if (nChar == '-') { ord--; - if (ord < 0) ord = 0xFF; else - if ((ord > maxpat) && (ord < 0xFE)) ord = maxpat; + if (ord < 0) ord = pSndFile->Patterns.GetInvalidIndex(); else + if ((ord > maxpat) && (ord < pSndFile->Patterns.GetIgnoreIndex())) ord = maxpat; } if (ord != pSndFile->Order[m_nScrollPos]) { - pSndFile->Order[m_nScrollPos] = (BYTE)ord; + pSndFile->Order[m_nScrollPos] = static_cast<UINT>(ord); m_pModDoc->SetModified(); m_pModDoc->UpdateAllViews(NULL, HINT_MODSEQUENCE, this); InvalidateSelection(); @@ -399,12 +409,20 @@ CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); s[0] = 0; - wsprintf(s, (CMainFrame::m_dwPatternSetup & PATTERN_HEXDISPLAY) ? "Position %02Xh of %02Xh" : "Position %d of %d", - m_nScrollPos, pSndFile->GetNumPatterns()); - if (m_nScrollPos < MAX_ORDERS) + if(CMainFrame::m_dwPatternSetup & PATTERN_HEXDISPLAY) { + wsprintf(s, "Position %02Xh of %02Xh", m_nScrollPos, pSndFile->GetNumPatterns()); + } + else + { + wsprintf(s, "Position %d of %d (%02Xh of %02Xh)", + m_nScrollPos, pSndFile->GetNumPatterns(), m_nScrollPos, pSndFile->GetNumPatterns()); + } + + if (m_nScrollPos < pSndFile->Order.size()) + { UINT nPat = pSndFile->Order[m_nScrollPos]; - if ((nPat < MAX_PATTERNS) && (nPat < pSndFile->m_nPatternNames)) + if ((nPat < pSndFile->Patterns.Size()) && (nPat < pSndFile->m_nPatternNames)) { CHAR szpat[40] = ""; if (pSndFile->GetPatternName(nPat, szpat)) @@ -450,7 +468,7 @@ while (rect.left < rcClient.right) { BOOL bHighLight = ((bFocus) && (nIndex == m_nScrollPos)) ? TRUE : FALSE; - int nOrder = ((nIndex >= 0) && (nIndex < MAX_ORDERS)) ? pSndFile->Order[nIndex] : -1; + int nOrder = ((nIndex >= 0) && (nIndex < pSndFile->Order.size())) ? pSndFile->Order[nIndex] : -1; if ((rect.right = rect.left + m_cxFont) > rcClient.right) rect.right = rcClient.right; rect.right--; FillRect(dc.m_hDC, &rect, (bHighLight) ? CMainFrame::brushHighLight : CMainFrame::brushWindow); @@ -482,9 +500,16 @@ s[0] = 0; if ((nOrder >= 0) && (rect.left + m_cxFont - 4 <= rcClient.right)) { - if (nOrder == 0xFF) strcpy(s, "---"); else - if (nOrder < MAX_PATTERNS) wsprintf(s, "%d", nOrder); - else strcpy(s, "+++"); + if (nOrder == pSndFile->Patterns.GetInvalidIndex()) strcpy(s, "---"); //Print the 'dots' + else + { + if (nOrder < pSndFile->Patterns.Size()) wsprintf(s, "%d", nOrder); + else + { + if(nOrder == pSndFile->Patterns.GetIgnoreIndex()) strcpy(s, "+++"); + else strcpy(s, "BUG"); + } + } } dc.SetTextColor((bHighLight) ? colorTextSel : colorText); dc.DrawText(s, -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER); @@ -531,7 +556,7 @@ { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); int nOrder = m_nXScroll + (pt.x - rect.left) / m_cxFont; - if ((nOrder >= 0) && (nOrder < MAX_ORDERS)) + if ((nOrder >= 0) && (nOrder < pSndFile->Order.size())) { if (pSndFile->m_nSeqOverride == nOrder+1) { pSndFile->m_nSeqOverride=0; @@ -599,7 +624,7 @@ if (rect.PtInRect(pt)) { n = m_nXScroll + (pt.x - rect.left) / m_cxFont; - if ((n < 0) || (n >= MAX_ORDERS)) n = -1; + if ((n < 0) || (n >= m_pModDoc->GetSoundFile()->Order.size())) n = -1; } if (n != (int)m_nDropPos) { @@ -638,7 +663,7 @@ HMENU hMenu = ::CreatePopupMenu(); UINT nCurrentPattern = GetCurrentPattern(); - bool patternExists = (nCurrentPattern<MAX_PATTERNS + bool patternExists = (nCurrentPattern < m_pModDoc->GetSoundFile()->Patterns.Size() && m_pModDoc->GetSoundFile()->Patterns[nCurrentPattern] != NULL); DWORD greyed = patternExists?FALSE:MF_GRAYED; @@ -651,7 +676,7 @@ AppendMenu(hMenu, MF_STRING|greyed, ID_ORDERLIST_COPY, "&Duplicate Pattern"); AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERNCOPY, "&Copy Pattern"); AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERNPASTE, "P&aste Pattern"); - if ((m_pModDoc) && (m_pModDoc->GetSoundFile()->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT))) + if ((m_pModDoc) && (m_pModDoc->GetSoundFile()->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT))) { AppendMenu(hMenu, MF_SEPARATOR, NULL, ""); AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERN_PROPERTIES, "&Properties..."); @@ -729,7 +754,14 @@ if (m_pModDoc) { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - for (int i=MAX_ORDERS-1; i>m_nScrollPos; i--) pSndFile->Order[i] = pSndFile->Order[i-1]; + //Checking whether there is some pattern at the end of orderlist. + + if(pSndFile->Order[pSndFile->Order.size()-1] < pSndFile->Patterns.Size()) + { + if(pSndFile->Order.size() < pSndFile->Order.GetOrderNumberLimitMax()) + pSndFile->Order.push_back(pSndFile->Patterns.GetInvalidIndex()); + } + for (int i=pSndFile->Order.size()-1; i>m_nScrollPos; i--) pSndFile->Order[i] = pSndFile->Order[i-1]; InvalidateRect(NULL, FALSE); m_pModDoc->SetModified(); m_pModDoc->UpdateAllViews(NULL, HINT_MODSEQUENCE, this); @@ -743,13 +775,13 @@ if (m_pModDoc) { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - for (int i=m_nScrollPos; i<MAX_ORDERS-1; i++) pSndFile->Order[i] = pSndFile->Order[i+1]; - pSndFile->Order[MAX_ORDERS-1] = 0xFF; + for (int i=m_nScrollPos; i<pSndFile->Order.size()-1; i++) pSndFile->Order[i] = pSndFile->Order[i+1]; + pSndFile->Order[pSndFile->Order.size()-1] = pSndFile->Patterns.GetInvalidIndex(); InvalidateRect(NULL, FALSE); m_pModDoc->SetModified(); m_pModDoc->UpdateAllViews(NULL, HINT_MODSEQUENCE, this); UINT nNewOrd = pSndFile->Order[m_nScrollPos]; - if ((nNewOrd < MAX_PATTERNS) && (pSndFile->Patterns[nNewOrd]) && (m_pParent)) + if ((nNewOrd < pSndFile->Patterns.Size()) && (pSndFile->Patterns[nNewOrd]) && (m_pParent)) { m_pParent->SetCurrentPattern(nNewOrd); } @@ -837,11 +869,12 @@ CPoint pt; if ((!pDropInfo) || (!m_pModDoc) || (m_pModDoc != pDropInfo->pModDoc) || (!m_cxFont)) return FALSE; + pSndFile = m_pModDoc->GetSoundFile(); bCanDrop = FALSE; switch(pDropInfo->dwDropType) { case DRAGONDROP_ORDER: - if (pDropInfo->dwDropItem >= MAX_ORDERS) break; + if (pDropInfo->dwDropItem >= pSndFile->Order.size()) break; case DRAGONDROP_PATTERN: bCanDrop = TRUE; break; @@ -851,12 +884,11 @@ ScreenToClient(&pt); if (pt.x < 0) pt.x = 0; posdest = m_nXScroll + (pt.x / m_cxFont); - if (posdest >= MAX_ORDERS) return FALSE; - pSndFile = m_pModDoc->GetSoundFile(); + if (posdest >= pSndFile->Order.size()) return FALSE; switch(pDropInfo->dwDropType) { case DRAGONDROP_PATTERN: - pSndFile->Order[posdest] = (BYTE)pDropInfo->dwDropItem; + pSndFile->Order[posdest] = static_cast<UINT>(pDropInfo->dwDropItem); break; case DRAGONDROP_ORDER: Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -527,7 +527,7 @@ m_ComboSustainType.AddString("Off"); m_ComboSustainType.AddString("On"); // Bidirectional Loops - if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT)) + if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) { m_ComboLoopType.AddString("Bidi"); m_ComboSustainType.AddString("Bidi"); @@ -545,19 +545,19 @@ m_SpinSustainEnd.SetRange(-1, 1); m_SpinSustainEnd.SetPos(0); // Sustain Loops only available in IT - b = (m_pSndFile->m_nType == MOD_TYPE_IT) ? TRUE : FALSE; + b = (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE; m_ComboSustainType.EnableWindow(b); m_SpinSustainStart.EnableWindow(b); m_SpinSustainEnd.EnableWindow(b); m_EditSustainStart.EnableWindow(b); m_EditSustainEnd.EnableWindow(b); // Finetune / C-4 Speed / BaseNote - b = (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT)) ? TRUE : FALSE; + b = (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE; SetDlgItemText(IDC_TEXT7, (b) ? "Freq. (Hz)" : "Finetune"); m_SpinFineTune.SetRange(-1, 1); m_EditFileName.EnableWindow(b); // AutoVibrato - b = (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT)) ? TRUE : FALSE; + b = (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE; m_ComboAutoVib.EnableWindow(b); m_SpinVibSweep.EnableWindow(b); m_SpinVibDepth.EnableWindow(b); @@ -566,11 +566,11 @@ m_EditVibDepth.EnableWindow(b); m_EditVibRate.EnableWindow(b); // Global Volume - b = (m_pSndFile->m_nType == MOD_TYPE_IT) ? TRUE : FALSE; + b = (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE; m_EditGlobalVol.EnableWindow(b); m_SpinGlobalVol.EnableWindow(b); // Panning - b = (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT)) ? TRUE : FALSE; + b = (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE; m_CheckPanning.EnableWindow(b); m_EditPanning.EnableWindow(b); m_SpinPanning.EnableWindow(b); @@ -609,7 +609,7 @@ //end rewbs.fix36944 // FineTune / C-4 Speed / BaseNote int transp = 0; - if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT)) + if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) { wsprintf(s, "%lu", pins->nC4Speed); m_EditFineTune.SetWindowText(s); @@ -893,7 +893,7 @@ CFileDialog dlg(TRUE, NULL, NULL, - OFN_HIDEREADONLY | OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST, + OFN_HIDEREADONLY | OFN_ENABLESIZING | OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_ALLOWMULTISELECT, "All Samples|*.wav;*.pat;*.s3i;*.smp;*.snd;*.raw;*.xi;*.aif;*.aiff;*.its;*.8sv;*.8svx;*.svx;*.pcm|" "Wave Files (*.wav)|*.wav|" "XI Samples (*.xi)|*.xi|" @@ -909,9 +909,38 @@ dlg.m_ofn.lpstrInitialDir = CMainFrame::m_szCurSmpDir; } dlg.m_ofn.nFilterIndex = nLastIndex; + const size_t bufferSize = 2048; //Note: This is possibly the maximum buffer size in MFC 7(this note was written November 2006). + vector<char> filenameBuffer(bufferSize, 0); + dlg.GetOFN().lpstrFile = &filenameBuffer[0]; + dlg.GetOFN().nMaxFile = bufferSize; + if (dlg.DoModal() != IDOK) return; + nLastIndex = dlg.m_ofn.nFilterIndex; - if (!OpenSample(dlg.GetPathName())) ErrorBox(IDS_ERR_FILEOPEN, this); + + POSITION pos = dlg.GetStartPosition(); + size_t counter = 0; + while(pos != NULL) + { + //If loading multiple samples, advancing to next sample and creating + //new one if necessary. + if(counter > 0) + { + if(m_nSample >= MAX_SAMPLES-1) + break; + else + m_nSample++; + + if(m_nSample > m_pSndFile->GetNumSamples()) + OnSampleNew(); + } + + if(!OpenSample(dlg.GetNextPathName(pos))) + ErrorBox(IDS_ERR_FILEOPEN, this); + + counter++; + } + filenameBuffer.clear(); SwitchToView(); } @@ -926,7 +955,7 @@ SwitchToView(); return; } - if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT)) + if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) { memcpy(szFileName, m_pSndFile->Ins[m_nSample].name, 22); szFileName[22] = 0; @@ -2166,7 +2195,7 @@ memcpy(m_pSndFile->Ins[m_nSample].name, s, 22); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEINFO, this); - if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT)) m_pModDoc->SetModified(); + if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified(); } } @@ -2207,7 +2236,7 @@ { if (IsLocked()) return; BOOL b = FALSE; - if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT)) + if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) { b = IsDlgButtonChecked(IDC_CHECK1); } @@ -2216,14 +2245,14 @@ if (!(m_pSndFile->Ins[m_nSample].uFlags & CHN_PANNING)) { m_pSndFile->Ins[m_nSample].uFlags |= CHN_PANNING; - if (m_pSndFile->m_nType == MOD_TYPE_IT) m_pModDoc->SetModified(); + if (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified(); } } else { if (m_pSndFile->Ins[m_nSample].uFlags & CHN_PANNING) { m_pSndFile->Ins[m_nSample].uFlags &= ~CHN_PANNING; - if (m_pSndFile->m_nType == MOD_TYPE_IT) m_pModDoc->SetModified(); + if (m_pSndFile->m_nType == (MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified(); } } } @@ -2246,7 +2275,7 @@ if (nPan != m_pSndFile->Ins[m_nSample].nPan) { m_pSndFile->Ins[m_nSample].nPan = nPan; - if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT)) m_pModDoc->SetModified(); + if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified(); } } @@ -2256,7 +2285,7 @@ { if (IsLocked()) return; int n = GetDlgItemInt(IDC_EDIT5); - if (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_S3M)) + if (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_S3M|MOD_TYPE_MPT)) { if ((n >= 2000) && (n <= 256000) && (n != (int)m_pSndFile->Ins[m_nSample].nC4Speed)) { @@ -2290,7 +2319,7 @@ { if (IsLocked()) return; int n = 60 - (m_CbnBaseNote.GetCurSel() + BASENOTE_MIN); - if (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_S3M)) + if (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_S3M|MOD_TYPE_MPT)) { LONG ft = CSoundFile::FrequencyToTranspose(m_pSndFile->Ins[m_nSample].nC4Speed) & 0x7f; n = CSoundFile::TransposeToFrequency(n, ft); @@ -2724,7 +2753,7 @@ // FineTune / C-5 Speed if ((pos = (short int)m_SpinFineTune.GetPos()) != 0) { - if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT)) + if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) { LONG d = pins->nC4Speed; if (d < 1) d = 8363; @@ -2790,6 +2819,7 @@ } LRESULT CCtrlSamples::OnCustomKeyMsg(WPARAM wParam, LPARAM lParam) +//---------------------------------------------------------------- { if (wParam == kcNull) return NULL; Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -7,7 +7,11 @@ #include "view_pat.h" #include "EffectVis.h" //rewbs.fxvis #include "ChannelManagerDlg.h" +#include "../soundlib/tuning_template.h" +#include <string> +using std::string; + // Headers #define ROWHDR_WIDTH 32 // Row header #define COLHDR_HEIGHT 16 // Column header @@ -284,16 +288,24 @@ srcy = pfnt->nAlphaNZ_Y + 15 * COLUMN_HEIGHT; break; //end rewbs.velocity - + case ' ': + srcx = pfnt->nClrX; + srcy = pfnt->nClrY; + break; + case '-': + srcx = pfnt->nNoteX + pfnt->nNoteWidth/2; + srcy = pfnt->nNoteY + COLUMN_HEIGHT; + break; } m_Dib.TextBlt(x, y, sizex, COLUMN_HEIGHT, srcx+ofsx, srcy); } -void CViewPattern::DrawNote(int x, int y, UINT note) -//-------------------------------------------------- +void CViewPattern::DrawNote(int x, int y, UINT note, CTuning* pTuning) +//--------------------------------------------------------------------------- { PCPATTERNFONT pfnt = GetCurrentPatternFont(); + UINT xsrc = pfnt->nNoteX, ysrc = pfnt->nNoteY, dx = pfnt->nEltWidths[0]; if (!note) { @@ -308,11 +320,22 @@ m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 14*COLUMN_HEIGHT); } else { - UINT o = (note-1) / 12; - UINT n = (note-1) % 12; - m_Dib.TextBlt(x, y, pfnt->nNoteWidth, COLUMN_HEIGHT, xsrc, ysrc+(n+1)*COLUMN_HEIGHT); - m_Dib.TextBlt(x+pfnt->nNoteWidth, y, pfnt->nOctaveWidth, COLUMN_HEIGHT, - pfnt->nNumX, pfnt->nNumY+o*COLUMN_HEIGHT); + if(pTuning) + { + string noteStr = pTuning->GetNoteName(static_cast<CTuning::STEPTYPE>(note-NOTE_MIDDLEC)); + noteStr.resize(3, ' '); + DrawLetter(x, y, noteStr[0]); + DrawLetter(x + pfnt->nNoteWidth/2, y, noteStr[1]); + DrawLetter(x + pfnt->nNoteWidth, y, noteStr[2]); + } + else //Original + { + UINT o = (note-1) / 12; //Octave + UINT n = (note-1) % 12; //Note + m_Dib.TextBlt(x, y, pfnt->nNoteWidth, COLUMN_HEIGHT, xsrc, ysrc+(n+1)*COLUMN_HEIGHT); + m_Dib.TextBlt(x+pfnt->nNoteWidth, y, pfnt->nOctaveWidth, COLUMN_HEIGHT, + pfnt->nNumX, pfnt->nNumY+o*COLUMN_HEIGHT); + } } } @@ -407,7 +430,7 @@ const char *pszfmt = pSndFile->m_bChannelMuteTogglePending[ncolhdr]? "[Channel %d]" : "Channel %d"; // const char *pszfmt = pModDoc->IsChannelRecord(ncolhdr) ? "Channel %d " : "Channel %d"; // -! NEW_FEATURE#0012 - if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT)) && ((BYTE)pSndFile->ChnSettings[ncolhdr].szName[0] > 0x20)) + if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && ((BYTE)pSndFile->ChnSettings[ncolhdr].szName[0] > 0x20)) pszfmt = pSndFile->m_bChannelMuteTogglePending[ncolhdr]?"%d: [%s]":"%d: %s"; else if (m_nDetailLevel < 2) pszfmt = pSndFile->m_bChannelMuteTogglePending[ncolhdr]?"[Ch%d]":"Ch%d"; else if (m_nDetailLevel < 3) pszfmt = pSndFile->m_bChannelMuteTogglePending[ncolhdr]?"[Chn %d]":"Chn %d"; @@ -491,13 +514,13 @@ { UINT nCurOrder = SendCtrlMessage(CTRLMSG_GETCURRENTORDER); - if ((nCurOrder > 0) && (nCurOrder < MAX_ORDERS) && (pSndFile->Order[nCurOrder] == m_nPattern)) + if ((nCurOrder > 0) && (nCurOrder < pSndFile->Order.size()) && (pSndFile->Order[nCurOrder] == m_nPattern)) { nPrevPat = pSndFile->Order[nCurOrder-1]; bPrevPatFound = TRUE; } } - if ((bPrevPatFound) && (nPrevPat < MAX_PATTERNS) && (pSndFile->Patterns[nPrevPat])) + if ((bPrevPatFound) && (nPrevPat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[nPrevPat])) { UINT nPrevRows = pSndFile->PatternSize[nPrevPat]; UINT n = (nSkip < nPrevRows) ? nSkip : nPrevRows; @@ -535,12 +558,12 @@ BOOL bNextPatFound = FALSE; UINT nCurOrder = SendCtrlMessage(CTRLMSG_GETCURRENTORDER); - if ((nCurOrder+1 < MAX_ORDERS) && (pSndFile->Order[nCurOrder] == m_nPattern)) + if ((nCurOrder+1 < pSndFile->Order.size()) && (pSndFile->Order[nCurOrder] == m_nPattern)) { nNextPat = pSndFile->Order[nCurOrder+1]; bNextPatFound = TRUE; } - if ((bNextPatFound) && (nNextPat < MAX_PATTERNS) && (pSndFile->Patterns[nNextPat])) + if ((bNextPatFound) && (nNextPat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[nNextPat])) { UINT nNextRows = pSndFile->PatternSize[nNextPat]; UINT n = ((UINT)nVisRows < nNextRows) ? nVisRows : nNextRows; @@ -757,7 +780,10 @@ } // Drawing note m_Dib.SetTextColor(tx_col, bk_col); - DrawNote(xbmp+x, 0, m->note); + if(pSndFile->m_nType == MOD_TYPE_MPT && m->instr < MAX_INSTRUMENTS && pSndFile->Headers[m->instr]) + DrawNote(xbmp+x, 0, m->note, pSndFile->Headers[m->instr]->pTuning); + else //Original + DrawNote(xbmp+x, 0, m->note); } x += pfnt->nEltWidths[0]; // Instrument Modified: trunk/OpenMPT/mptrack/Globals.cpp =================================================================== --- trunk/OpenMPT/mptrack/Globals.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/Globals.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -395,7 +395,7 @@ UINT nType = pSndFile->GetType(); UINT mask = 1 | 2 | 4 | 16; - if (nType & (MOD_TYPE_XM|MOD_TYPE_IT)) + if (nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) { mask |= 8; //mask |= 32; //rewbs.graph Modified: trunk/OpenMPT/mptrack/KeyConfigDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/KeyConfigDlg.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/KeyConfigDlg.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -229,9 +229,9 @@ for (int c=kcClearRow; c<=kcInsertAllRows; c++) newCat->commands.Add(c); newCat->separators.Add(kcInsertAllRows); //-------------------------------------- - for (int c=kcChannelMute; c<=kcToggleChanMuteOnPatTransition; c++) + for (int c=kcChannelMute; c<=kcSoloChnOnPatTransition; c++) newCat->commands.Add(c); - newCat->separators.Add(kcToggleChanMuteOnPatTransition); //-------------------------------------- + newCat->separators.Add(kcSoloChnOnPatTransition); //-------------------------------------- for (int c=kcTransposeUp; c<=kcTransposeOctDown; c++) newCat->commands.Add(c); newCat->separators.Add(kcTransposeOctDown); //-------------------------------------- Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2007-03-14 00:19:33 UTC (rev 175) @@ -352,6 +352,8 @@ m_InputHandler = new CInputHandler(this); //rewbs.customKeys m_pPerfCounter= new CPerformanceCounter(); + //Loading static tunings here - probably not the best place to do that but anyway. + CSoundFile::LoadStaticTunings(); } void CMainFrame::LoadIniSettings() @@ -644,6 +646,8 @@ delete m_InputHandler; //rewbs.customKeys delete m_pAutoSaver; //rewbs.autosaver delete m_pPerfCounter; + + CChannelManagerDlg::DestroySharedInstance(); } int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) @@ -1988,11 +1992,9 @@ m_WaveFile.m_nSamples = 1; m_WaveFile.Order[0] = 0; m_WaveFile.Order[1] = 1; - m_WaveFile.Order[2] = 0xFF; - m_WaveFile.PatternSize[0] = 64; - m_WaveFile.PatternSize[1] = 64; - m_WaveFile.Patterns[0] = CSoundFile::AllocatePattern(64, 4); - m_WaveFile.Patterns[1] = CSoundFile::AllocatePattern(64, 4); + m_WaveFile.Order[2] = m_WaveFile.Patterns.GetInvalidIndex(); + m_WaveFile.Patterns.Insert(0,64); + m_WaveFile.Patterns.Insert(1,64); if (m_WaveFile.Patterns[0]) { if (!nNote) nNote = 5*12+1; @@ -2063,11 +2065,9 @@ } m_WaveFile.Order[0] = 0; m_WaveFile.Order[1] = 1; - m_WaveFile.Order[2] = 0xFF; - m_WaveFile.PatternSize[0] = 64; - m_WaveFile.PatternSize[1] = 64; - m_WaveFile.Patterns[0] = CSoundFile::AllocatePattern(64, 4); - m_WaveFile.Patterns[1] = CSoundFile::AllocatePattern(64, 4); + m_WaveFile.Order[2] = m_WaveFile.Patterns.GetInvalidIndex(); + m_WaveFile.Patterns.Insert(0, 64); + m_WaveFile.Patterns.Insert(1, 64); if (m_WaveFile.Patterns[0]) { if (!nNote) nNote = 5*12+1; @@ -2543,7 +2543,7 @@ if (m_pSndFile != &m_WaveFile) { UINT nPat = m_pSndFile->m_nPattern; - if (nPat < MAX_PATTERNS) + if(nPat < m_pSndFile->Patterns.Size()) { if (nPat < 10) strcat(s, " "); if (nPat < 100) strcat(s, " "); Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2007-03-13 22:14:22 UTC (rev 174) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2007... [truncated message content] |
From: <rel...@us...> - 2007-04-01 00:28:21
|
Revision: 177 http://svn.sourceforge.net/modplug/?rev=177&view=rev Author: relabsoluness Date: 2007-03-31 17:28:16 -0700 (Sat, 31 Mar 2007) Log Message: ----------- . v1.17.02.46 (Still in progress, no binaries) <Relabs> . No longer possible to enter a tunename which is longer than the maximum length that can be stored to an IT-file(yet to be fixed for other formats). <Relabs> . When opening instruments, load dialog didn't remember its previous path. <Relabs> / Changed the way channels are reset when jumping between patterns in orderlist. <Relabs> / Added version number to the mainframe title. <Relabs> ./ Changed the way panning is treated(sndmix.cpp, lines around 1620) since I think for example that the behavior of panbrello had changed for RC2 plugin levels in rev. 174. Please correct if it's wrong now. <Relabs> / Serialization related tweaking(tuning related). MPTm/tuning files created with this version (likely) won't open in the tuning-branch('RC3') version. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/Node.h trunk/OpenMPT/mptrack/Stdafx.h trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/misc_util.cpp trunk/OpenMPT/mptrack/misc_util.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/serialization_utils.cpp trunk/OpenMPT/mptrack/serialization_utils.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/mod_specifications.h trunk/OpenMPT/soundlib/tuning.cpp trunk/OpenMPT/soundlib/tuningCollection.cpp trunk/OpenMPT/soundlib/tuning_template.h trunk/OpenMPT/soundlib/tuningcollection.h Added Paths: ----------- trunk/OpenMPT/mptrack/typedefs.h Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -80,7 +80,11 @@ { CModControlDlg::OnInitDialog(); // Song Title - m_EditTitle.SetLimitText(31); + if(m_pSndFile) + m_EditTitle.SetLimitText(m_pSndFile->GetModNameLengthMax()); + else + m_EditTitle.SetLimitText(31); + // -> CODE#0016 // -> DESC="default tempo update" // m_SpinTempo.SetRange(32, 255); // 255 bpm max @@ -98,7 +102,6 @@ m_SliderSamplePreAmp.SetRange(0, MAX_SLIDER_SAMPLE_VOL); - // -! BEHAVIOUR_CHANGE#0016 m_ComboResampling.AddString("None"); m_ComboResampling.AddString("Linear"); @@ -299,14 +302,14 @@ void CCtrlGeneral::OnTitleChanged() //--------------------------------- { - CHAR s[80]; + CHAR s[35]; if ((!m_pSndFile) || (!m_EditTitle.m_hWnd) || (!m_EditTitle.GetModify())) return; memset(s, 0, sizeof(s)); m_EditTitle.GetWindowText(s, sizeof(s)); - s[31] = 0; + s[25] = 0; if (strcmp(m_pSndFile->m_szNames[0], s)) { - memcpy(m_pSndFile->m_szNames[0], s, 32); + memcpy(m_pSndFile->m_szNames[0], s, 26); if (m_pModDoc) { m_EditTitle.SetModify(FALSE); @@ -723,5 +726,3 @@ SelectObject(hdc, oldpen); m_nDisplayedVu = m_nVuMeter; } - - Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -1262,9 +1262,10 @@ if (penv) { CHAR szPath[_MAX_PATH], szNewPath[_MAX_PATH]; - _splitpath(lpszFileName, szPath, szNewPath, szName, szExt); + _splitpath(lpszFileName, szNewPath, szPath, szName, szExt); strcat(szNewPath, szPath); strcpy(CMainFrame::m_szCurInsDir, szNewPath); + if (!penv->name[0]) { szName[31] = 0; Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -207,6 +207,7 @@ pSndFile->m_nCurrentPattern = pSndFile->m_nNextPattern = m_nScrollPos; pMainFrm->ResetNotificationBuffer(); //rewbs.toCheck pSndFile->m_nNextRow = 0; + pSndFile->ResetChannelSettings(CHNRESET_BASIC); END_CRITICAL(); } else if (m_pParent->GetFollowSong()) @@ -216,6 +217,8 @@ pSndFile->m_nCurrentPattern = m_nScrollPos; pSndFile->SetCurrentOrder(m_nScrollPos); pSndFile->m_dwSongFlags |= dwPaused; + pSndFile->ResetChannelSettings(CHNRESET_BASIC); + //if (!(dwPaused & SONG_PATTERNLOOP)) pSndFile->GetLength(TRUE); //Relabs.note: Commented above line for it seems to cause //significant slowdown when changing patterns without Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -113,8 +113,8 @@ END_MESSAGE_MAP() // Static -static gdwLastLowLatencyTime = 0; -static gdwLastMixActiveTime = 0; +static int gdwLastLowLatencyTime = 0; +static int gdwLastMixActiveTime = 0; static DWORD gsdwTotalSamples = 0; static DWORD gdwPlayLatency = 0; @@ -443,6 +443,7 @@ } void CMainFrame::LoadRegistrySettings() +//------------------------------------- { HKEY key; @@ -600,6 +601,16 @@ { CHAR s[256]; + //Adding version number to the frame title + CString title = GetTitle(); + #ifdef DEBUG + title += CString(" DEBUG"); + #endif + title += CString(" ") + GetFullVersionString(); + SetTitle(title); + OnUpdateFrameTitle(false); + + // Load Chords theApp.LoadChords(Chords); // Check for valid sound device Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -1042,6 +1042,7 @@ } BOOL CModDoc::NoFxChannel(UINT nChn, BOOL bNoFx, BOOL updateMix) +//-------------------------------------------------------------- { if (nChn >= m_SndFile.m_nChannels) return FALSE; if (m_SndFile.m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) SetModified(); @@ -2791,6 +2792,7 @@ void CModDoc::OnPatternRestart() +//------------------------------ { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CChildFrame *pChildFrm = (CChildFrame *) GetChildFrame(); @@ -2811,6 +2813,12 @@ CModDoc *pModPlaying = pMainFrm->GetModPlaying(); BEGIN_CRITICAL(); + + m_SndFile.SetCurrentPos(0); + //Relabs.note: Dirty hack to try to make replay pattern to be + //more like 'play song from start' - a little clean up for + //these playback calls would be nice (March 2007). + // Cut instruments/samples for (UINT i=0; i<MAX_CHANNELS; i++) { @@ -2842,6 +2850,7 @@ } void CModDoc::OnPatternPlay() +//--------------------------- { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CChildFrame *pChildFrm = (CChildFrame *) GetChildFrame(); @@ -2890,6 +2899,7 @@ } void CModDoc::OnPatternPlayNoLoop() +//--------------------------------- { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CChildFrame *pChildFrm = (CChildFrame *) GetChildFrame(); @@ -3115,4 +3125,4 @@ if (bShowLog) ShowLog("Conversion Status", CMainFrame::GetMainFrame()); SetModified(); } -} \ No newline at end of file +} Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -520,10 +520,8 @@ { if ((m[i].note) || (m[i].instr) || (m[i].volcmd) || (m[i].command)) goto NotEmpty; } - BEGIN_CRITICAL(); m_SndFile.Patterns.Remove(ipat); nPatRemoved++; - END_CRITICAL(); NotEmpty: ; } @@ -2054,3 +2052,4 @@ return nPattern; } + Modified: trunk/OpenMPT/mptrack/Node.h =================================================================== --- trunk/OpenMPT/mptrack/Node.h 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/Node.h 2007-04-01 00:28:16 UTC (rev 177) @@ -20,7 +20,7 @@ virtual CString GetLabel() = 0; virtual HPEN GetBorderPen() = 0; - ConnectInput(int input, CNode sourceNode, int sourceNodeOutput); + int ConnectInput(int input, CNode sourceNode, int sourceNodeOutput); protected: int x,y; Modified: trunk/OpenMPT/mptrack/Stdafx.h =================================================================== --- trunk/OpenMPT/mptrack/Stdafx.h 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/Stdafx.h 2007-04-01 00:28:16 UTC (rev 177) @@ -69,6 +69,8 @@ void Log(LPCSTR format,...); +#include "typedefs.h" + //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -1249,6 +1249,7 @@ } else { + MessageBox("Saving succesful."); m_ModifiedTCs[m_pActiveTuningCollection] = false; } } Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -3472,6 +3472,8 @@ } } + +#ifdef TRADITIONAL_MODCOMMAND void CViewPattern::TempEnterFX(int c) //----------------------------------- { @@ -3522,7 +3524,53 @@ } } // end if mainframe & moddoc exist } +#else +void CViewPattern::TempEnterFX(int e /*EFFECT_ID eID*/) +//----------------------------------- +{ + CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); + CModDoc *pModDoc = GetDocument(); + CSoundFile *pSndFile = (pModDoc) ? pModDoc->GetSoundFile() : NULL; + if(!pSndFile || !pMainFrm) + return; + + EFFECT_ID eID = e; + + const ROWINDEX r = m_nRow; + const CHANNELINDEX c = GetChanFromCursor(m_dwCursor); + const MODCOMMAND *p = pSndFile->Patterns[m_nPattern].GetpModCommand(r, c); + MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite + + PrepareUndo(m_dwBeginSel, m_dwEndSel); + + //Checking whether to use the param of previous effect. + if (eID) + { + if ((eID == m_cmdOld.GetEffect()) && (!p->GetEffectParam()) && (!p->GetEffect())) + pSndFile->Patterns[m_nPattern].SetModCommandEffectParam(r, c, m_cmdOld.GetEffectParam()); + else + m_cmdOld.SetEffectParam(0); + + m_cmdOld.SetEffectByID(eID); + } + pSndFile->Patterns[m_nPattern].SetModCommandEffect(r, c, eID); + + if (IsEditingEnabled_bmsg()) + { + DWORD sel = (m_nRow << 16) | m_dwCursor; + SetCurSel(sel, sel); + sel &= ~7; + if(oldcmd != *p) + { + pModDoc->SetModified(); + InvalidateArea(sel, sel+5); + UpdateIndicator(); + } + } +} +#endif + void CViewPattern::TempEnterFXparam(int v) //---------------------------------------- { @@ -4793,3 +4841,5 @@ return false; } + + Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -785,8 +785,8 @@ CComboBox *combo; CDialog::OnInitDialog(); combo = (CComboBox *)GetDlgItem(IDC_COMBO1); - CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - if ((m_pModDoc) && (m_nPattern < pSndFile->Patterns.Size()) && (combo)) + CSoundFile *pSndFile = (m_pModDoc) ? m_pModDoc->GetSoundFile() : NULL; + if ((pSndFile) && (m_nPattern < pSndFile->Patterns.Size()) && (combo)) { CHAR s[256]; UINT nrows = pSndFile->PatternSize[m_nPattern]; @@ -794,17 +794,14 @@ // -> CODE#0008 // -> DESC="#define to set pattern size" // for (UINT irow=32; irow<=256; irow++) - for (UINT irow=32; irow<=MAX_PATTERN_ROWS; irow++) +// for (UINT irow=32; irow<=MAX_PATTERN_ROWS; irow++) + for (UINT irow=pSndFile->GetRowMin(); irow<=pSndFile->GetRowMax(); irow++) // -! BEHAVIOUR_CHANGE#0008 { wsprintf(s, "%d", irow); combo->AddString(s); } - if (nrows < 32) - { - wsprintf(s, "%d", nrows); - combo->SetWindowText(s); - } else combo->SetCurSel(nrows-32); + combo->SetCurSel(nrows-pSndFile->GetRowMin()); wsprintf(s, "Pattern #%d:\x0d\x0a %d rows (%dK)", m_nPattern, pSndFile->PatternSize[m_nPattern], @@ -1272,36 +1269,75 @@ BEGIN_MESSAGE_MAP(CPageEditEffect, CPageEditCommand) ON_WM_HSCROLL() ON_CBN_SELCHANGE(IDC_COMBO1, OnCommandChanged) + ON_CBN_SELCHANGE(IDC_COMBO2, OnCommand2Changed) END_MESSAGE_MAP() void CPageEditEffect::UpdateDialog() //---------------------------------- { - CHAR s[128]; - CComboBox *combo; - CSoundFile *pSndFile; - - if ((!m_pModDoc) || (!m_bInitialized)) return; - pSndFile = m_pModDoc->GetSoundFile(); - if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL) - { - UINT numfx = m_pModDoc->GetNumEffects(); - UINT fxndx = m_pModDoc->GetIndexFromEffect(m_nCommand, m_nParam); - combo->ResetContent(); - combo->SetItemData(combo->AddString(" None"), (DWORD)-1); - if (!m_nCommand) combo->SetCurSel(0); - for (UINT i=0; i<numfx; i++) + #ifdef TRADITIONAL_MODCOMMAND + CHAR s[128]; + CComboBox *combo; + CSoundFile *pSndFile; + + if ((!m_pModDoc) || (!m_bInitialized)) return; + pSndFile = m_pModDoc->GetSoundFile(); + if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL) { - if (m_pModDoc->GetEffectInfo(i, s, TRUE)) + UINT numfx = m_pModDoc->GetNumEffects(); + UINT fxndx = m_pModDoc->GetIndexFromEffect(m_nCommand, m_nParam); + combo->ResetContent(); + combo->SetItemData(combo->AddString(" None"), (DWORD)-1); + if (!m_nCommand) combo->SetCurSel(0); + for (UINT i=0; i<numfx; i++) { - int k = combo->AddString(s); - combo->SetItemData(k, i); - if (i == fxndx) combo->SetCurSel(k); + if (m_pModDoc->GetEffectInfo(i, s, TRUE)) + { + int k = combo->AddString(s); + combo->SetItemData(k, i); + if (i == fxndx) combo->SetCurSel(k); + } } } - } - UpdateRange(FALSE); + UpdateRange(FALSE); + #else //Modcommand testing + CHAR s[128]; + CComboBox *combo = (CComboBox *)GetDlgItem(IDC_COMBO1); + CComboBox *combo2 = (CComboBox *)GetDlgItem(IDC_COMBO2); + CSoundFile *pSndFile; + + if ((!m_pModDoc) || (!m_bInitialized)) return; + pSndFile = m_pModDoc->GetSoundFile(); + if (combo && combo2) + { + combo->ResetContent(); + combo2->ResetContent(); + combo->SetItemData(combo->AddString(" None"), (DWORD)-1); + combo2->SetItemData(combo2->AddString(" None"), (DWORD)-1); + + UINT numfx = m_pModDoc->GetNumEffects(); + const UINT fxndx1 = m_pModDoc->GetIndexFromEffect(m_pModcommand->GetEffect(0), m_pModcommand->GetEffectParam(0)); + const UINT fxndx2 = m_pModDoc->GetIndexFromEffect(m_pModcommand->GetEffect(1), m_pModcommand->GetEffectParam(1)); + + if(!m_pModcommand->GetEffect(0)) combo->SetCurSel(0); + if(!m_pModcommand->GetEffect(1)) combo2->SetCurSel(0); + + for (UINT i=0; i<numfx; i++) + { + if (m_pModDoc->GetEffectInfo(i, s, TRUE)) + { + int k = combo->AddString(s); + combo->SetItemData(k, i); + int k2 = combo2->AddString(s); + combo2->SetItemData(k2, i); + if (i == fxndx1) combo->SetCurSel(k); + if (i == fxndx2) combo2->SetCurSel(k2); + } + } + } + UpdateRange(FALSE); + #endif } Modified: trunk/OpenMPT/mptrack/misc_util.cpp =================================================================== --- trunk/OpenMPT/mptrack/misc_util.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/misc_util.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -1,44 +1,2 @@ #include "stdafx.h" #include "misc_util.h" - - -bool StringToBinaryStream(ostream& outStream, const string& str) -//---------------------------------------------------- -{ - if(!outStream.good()) return true; - size_t size = str.size(); - outStream.write(reinterpret_cast<char*>(&size), sizeof(size)); - outStream << str; - if(outStream.good()) - return false; - else - return true; - -} - -bool StringFromBinaryStream(istream& inStrm, string& str, const size_t maxSize) -//--------------------------------------------------------- -{ - if(!inStrm.good()) return true; - size_t strSize; - inStrm.read(reinterpret_cast<char*>(&strSize), sizeof(strSize)); - - if(strSize > maxSize) - return true; - - str.resize(strSize); - - //Inefficiently reading to temporary buffer first and - //then setting that to the string. - char* buffer = new char[strSize+1]; - inStrm.read(buffer, strSize); - buffer[strSize] = '\0'; - str = buffer; - delete[] buffer; buffer = 0; - - - if(inStrm.good()) - return false; - else - return true; -} Modified: trunk/OpenMPT/mptrack/misc_util.h =================================================================== --- trunk/OpenMPT/mptrack/misc_util.h 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/misc_util.h 2007-04-01 00:28:16 UTC (rev 177) @@ -4,21 +4,20 @@ #include <vector> #include <sstream> #include <string> +#include <limits> using namespace std; -const UINT STRINGMAXSIZE = 1000; -const UINT VECTORMAXSIZE = 1000; -//Default sizelimits to string/vector load methods. -//Size limits are there to prevent corrupted streams from -//causing e.g. program to try to load of vector of size 2 000 000 000. +#include "typedefs.h" -template<class T> +template<class T, class SIZETYPE> bool VectorToBinaryStream(ostream& outStrm, const vector<T>& v) //------------------------------------------------------------ { if(!outStrm.good()) return true; - size_t s = v.size(); + if((std::numeric_limits<SIZETYPE>::max)() < v.size()) return true; + + SIZETYPE s = static_cast<SIZETYPE>(v.size()); outStrm.write(reinterpret_cast<const char*>(&s), sizeof(s)); vector<T>::const_iterator iter = v.begin(); for(iter; iter != v.end(); iter++) @@ -30,19 +29,20 @@ return true; } -template<class T> -bool VectorFromBinaryStream(istream& inStrm, vector<T>& v, const size_t maxSize = VECTORMAXSIZE) + +template<class T, class SIZETYPE> +bool VectorFromBinaryStream(istream& inStrm, vector<T>& v, const SIZETYPE maxSize = (std::numeric_limits<SIZETYPE>::max)()) //--------------------------------------------------------- { if(!inStrm.good()) return true; - size_t size; + + SIZETYPE size; inStrm.read(reinterpret_cast<char*>(&size), sizeof(size)); if(size > maxSize) return true; v.resize(size); - ASSERT(v.size() == size); for(size_t i = 0; i<size; i++) { inStrm.read(reinterpret_cast<char*>(&v[i]), sizeof(T)); @@ -53,10 +53,49 @@ return true; } -bool StringToBinaryStream(ostream& outStream, const string& str); -bool StringFromBinaryStream(istream& inStrm, string& str, const size_t maxSize = STRINGMAXSIZE); +template<class SIZETYPE> +bool StringToBinaryStream(ostream& outStream, const string& str) +//-------------------------------------------------------------- +{ + if(!outStream.good()) return true; + if((std::numeric_limits<SIZETYPE>::max)() < str.size()) return true; + SIZETYPE size = static_cast<SIZETYPE>(str.size()); + outStream.write(reinterpret_cast<char*>(&size), sizeof(size)); + outStream << str; + if(outStream.good()) + return false; + else + return true; +} + + +template<class SIZETYPE> +bool StringFromBinaryStream(istream& inStrm, string& str, const SIZETYPE maxSize = (std::numeric_limits<SIZETYPE>::max)()) +//-------------------------------------------------------------------------------------------- +{ + if(!inStrm.good()) return true; + + SIZETYPE strSize; + inStrm.read(reinterpret_cast<char*>(&strSize), sizeof(strSize)); + + if(strSize > maxSize) + return true; + + str.resize(strSize); + + //Copying string from stream one character at a time. + for(SIZETYPE i = 0; i<strSize; i++) + inStrm.read(&str[i], 1); + + if(inStrm.good()) + return false; + else + return true; +} + + template<class T> inline string Stringify(const T& x) //-------------------------- Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/mptrack.rc 2007-04-01 00:28:16 UTC (rev 177) @@ -1269,6 +1269,12 @@ CONTROL "Slider1",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,104,15,114,12 LTEXT "Effect Type:",IDC_STATIC,0,4,55,8 + LTEXT "Value:",IDC_TEXT2,183,1,35,8,NOT WS_VISIBLE + COMBOBOX IDC_COMBO2,78,0,16,83,CBS_DROPDOWNLIST | CBS_SORT | NOT + WS_VISIBLE | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_SLIDER2,"msctls_trackbar32",TBS_BOTH | + TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,134,0,43,12 + LTEXT "Effect Type:",IDC_STATIC,54,1,19,8,NOT WS_VISIBLE END IDD_SAMPLE_AMPLIFY DIALOGEX 0, 0, 175, 66 Modified: trunk/OpenMPT/mptrack/serialization_utils.cpp =================================================================== --- trunk/OpenMPT/mptrack/serialization_utils.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/serialization_utils.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -1,37 +1,7 @@ #include "stdafx.h" #include "serialization_utils.h" -#include "misc_util.h" -bool ReadTuningMap(istream& fin, map<WORD, string>& shortToTNameMap, const size_t maxNum) -//---------------------------------------- -{ - typedef map<WORD, string> MAP; - typedef MAP::iterator MAP_ITER; - size_t numTuning = 0; - fin.read(reinterpret_cast<char*>(&numTuning), sizeof(numTuning)); - if(numTuning > maxNum) - { - fin.setstate(ios::failbit); - return true; - } - for(size_t i = 0; i<numTuning; i++) - { - string temp; - unsigned short ui; - if(StringFromBinaryStream(fin, temp)) - { - fin.setstate(ios::failbit); - return true; - } - fin.read(reinterpret_cast<char*>(&ui), sizeof(ui)); - shortToTNameMap[ui] = temp; - } - if(fin.good()) - return false; - else - return true; -} Modified: trunk/OpenMPT/mptrack/serialization_utils.h =================================================================== --- trunk/OpenMPT/mptrack/serialization_utils.h 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/mptrack/serialization_utils.h 2007-04-01 00:28:16 UTC (rev 177) @@ -5,13 +5,49 @@ #include <string> #include <map> #include <fstream> +#include "misc_util.h" + + using namespace std; const size_t MAX_TUNING_NUM_DEFAULT = 1000; -bool ReadTuningMap(istream&, map<WORD, string>&, const size_t maxNum = MAX_TUNING_NUM_DEFAULT); +template<class TUNNUMTYPE, class STRSIZETYPE> +bool ReadTuningMap(istream& fin, map<WORD, string>& shortToTNameMap, const size_t maxNum = MAX_TUNING_NUM_DEFAULT) +//---------------------------------------------------------------------------------------- +{ + //In first versions: SIZETYPE1 == SIZETYPE2 == size_t == uint64. + typedef map<WORD, string> MAP; + typedef MAP::iterator MAP_ITER; + TUNNUMTYPE numTuning = 0; + fin.read(reinterpret_cast<char*>(&numTuning), sizeof(numTuning)); + if(numTuning > maxNum) + { + fin.setstate(ios::failbit); + return true; + } + for(size_t i = 0; i<numTuning; i++) + { + string temp; + uint16 ui; + if(StringFromBinaryStream<STRSIZETYPE>(fin, temp)) + { + fin.setstate(ios::failbit); + return true; + } + + fin.read(reinterpret_cast<char*>(&ui), sizeof(ui)); + shortToTNameMap[ui] = temp; + } + if(fin.good()) + return false; + else + return true; +} + + enum //Serialization Message { SM_UNKNOWN = 0, @@ -19,7 +55,7 @@ }; //============================================== -class CCharStreamBufFrom : public std::streambuf +class CCharBufferStreamIn : public std::streambuf //============================================== { private: @@ -29,7 +65,7 @@ return rv; } public: - CCharStreamBufFrom() {} + CCharBufferStreamIn() {} protected: streambuf* setbuf(char_type* buffer, std::streamsize count) Added: trunk/OpenMPT/mptrack/typedefs.h =================================================================== --- trunk/OpenMPT/mptrack/typedefs.h (rev 0) +++ trunk/OpenMPT/mptrack/typedefs.h 2007-04-01 00:28:16 UTC (rev 177) @@ -0,0 +1,19 @@ +#ifndef TYPEDEFS_H +#define TYPEDEFS_H + +#ifdef WIN32 + typedef __int8 int8; + typedef __int16 int16; + typedef __int32 int32; + typedef __int64 int64; + + typedef unsigned __int8 uint8; + typedef unsigned __int16 uint16; + typedef unsigned __int32 uint32; + typedef size_t uint64; + + typedef float float32; + +#endif + +#endif Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -3252,12 +3252,13 @@ while ((header.patnum > 0) && (!Patterns[header.patnum-1])) header.patnum--; //VERSION - //header.cwtv = 0x888; // We don't use these version info fields any more. - header.cwtv = 0x88B; // But now they are in use again :) + header.cwtv = 0x88C; // Used in OMPT-hack versioning. header.cmwt = 0x888; // Might come up as "Impulse Tracker 8" file in XMPlay. :) /* Version history: + 0x88B -> 0x88C: Changed type in which tuning number is printed + to file: size_t -> uint16. 0x88A -> 0x88B: Changed order-to-pattern-index table type from BYTE-array to vector<UINT>. */ @@ -3836,7 +3837,7 @@ //...and write the map with tuning names replacing //the addresses. - const size_t tuningMapSize = tNameToShort_Map.size(); + const uint16 tuningMapSize = tNameToShort_Map.size(); fout.write(reinterpret_cast<const char*>(&tuningMapSize), sizeof(tuningMapSize)); if(tuningMapSize == 0) { @@ -3847,9 +3848,9 @@ for(TNTS_MAP_ITER iter = tNameToShort_Map.begin(); iter != tNameToShort_Map.end(); iter++) { if(iter->first) - StringToBinaryStream(fout, iter->first->GetName()); + StringToBinaryStream<uint8>(fout, iter->first->GetName()); else //Case: Using original IT tuning. - StringToBinaryStream(fout, "->MPT_ORIGINAL_IT<-"); + StringToBinaryStream<uint8>(fout, "->MPT_ORIGINAL_IT<-"); fout.write(reinterpret_cast<const char*>(&(iter->second)), sizeof(iter->second)); } @@ -4469,7 +4470,9 @@ //START - mpt specific: //Using member cwtv on pifh as the version number. - if(pifh->cwtv > 0x889) + const uint16 version = pifh->cwtv; + try{ + if(version > 0x889) { const char* const cpcMPTStart = reinterpret_cast<const char*>(lpStream + mptStartPos); @@ -4483,21 +4486,23 @@ //std::streambuf which can be used in the istream //methods. So this was new to me, and checking this //might be a good idea. - CCharStreamBufFrom cbs; + CCharBufferStreamIn cbs; cbs.pubsetbuf((char*)cpcMPTStart, dwMemLength-mptStartPos); istream fin(&cbs); if(m_TuningsTuneSpecific.UnSerializeBinary(fin)) { - ::MessageBox(NULL, "Error occured - loading failed while trying to load tune specific tunings.", 0, MB_OK); - return FALSE; + throw(exception("Error occured - loading failed while trying to load tune specific tunings.")); } //2. Reading tuning id <-> tuning name map. typedef map<WORD, string> MAP; typedef MAP::iterator MAP_ITER; MAP shortToTNameMap; - ReadTuningMap(fin, shortToTNameMap); + if(version < 0x88C) + ReadTuningMap<uint64, uint64>(fin, shortToTNameMap); + else + ReadTuningMap<uint16, uint8>(fin, shortToTNameMap); //Read & set tunings for instruments list<string> notFoundTunings; @@ -4556,6 +4561,12 @@ //End read&set instrument tunings } //version condition(MPT) + } //try block ends + catch(exception& e) + { + ::MessageBox(0, e.what(), "", MB_ICONERROR); + return TRUE; //Return value to be revised. + } Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -143,13 +143,13 @@ case CMD_GLOBALVOLSLIDE: command = 'W'; break; case CMD_PANNING8: command = 'X'; - if ((bIT) && (m_nType != MOD_TYPE_IT) && (m_nType != MOD_TYPE_XM)) + if ((bIT) && (!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) && (m_nType != MOD_TYPE_XM)) { if (param == 0xA4) { command = 'S'; param = 0x91; } else if (param <= 0x80) { param <<= 1; if (param > 255) param = 255; } else command = param = 0; } else - if ((!bIT) && ((m_nType == MOD_TYPE_IT) || (m_nType == MOD_TYPE_XM))) + if ((!bIT) && ((m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) || (m_nType == MOD_TYPE_XM))) { param >>= 1; } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -349,7 +349,7 @@ GET_MPTHEADER_sized_member( nCutSwing , BYTE , CS.. ) GET_MPTHEADER_sized_member( nResSwing , BYTE , RS.. ) GET_MPTHEADER_sized_member( nFilterMode , BYTE , FM.. ) -GET_MPTHEADER_sized_member( wPitchToTempoLock , WORD , PTTL , ) +GET_MPTHEADER_sized_member( wPitchToTempoLock , WORD , PTTL ) GET_MPTHEADER_sized_member( nPitchEnvReleaseNode, BYTE , PERN ) GET_MPTHEADER_sized_member( nPanEnvReleaseNode , BYTE , AERN ) GET_MPTHEADER_sized_member( nVolEnvReleaseNode , BYTE , VERN ) @@ -1033,51 +1033,13 @@ //--------------------------------------- { UINT i, nPattern; + BYTE resetMask = (!nPos) ? CHNRESET_TOTAL : CHNRESET_MOST; for (i=0; i<MAX_CHANNELS; i++) - { - Chn[i].nNote = Chn[i].nNewNote = Chn[i].nNewIns = 0; - Chn[i].pInstrument = NULL; - Chn[i].pHeader = NULL; - Chn[i].nPortamentoDest = 0; - Chn[i].nCommand = 0; - Chn[i].nPatternLoopCount = 0; - Chn[i].nPatternLoop = 0; - Chn[i].nFadeOutVol = 0; - Chn[i].dwFlags |= CHN_KEYOFF|CHN_NOTEFADE; - Chn[i].nTremorCount = 0; - } + ResetChannelSettings(i, resetMask); + if (!nPos) { - for (i=0; i<MAX_CHANNELS; i++) - { - Chn[i].nPeriod = 0; - Chn[i].nPos = Chn[i].nLength = 0; - Chn[i].nLoopStart = 0; - Chn[i].nLoopEnd = 0; - Chn[i].nROfs = Chn[i].nLOfs = 0; - Chn[i].pSample = NULL; - Chn[i].pInstrument = NULL; - Chn[i].pHeader = NULL; - Chn[i].nCutOff = 0x7F; - Chn[i].nResonance = 0; - Chn[i].nFilterMode = 0; - Chn[i].nLeftVol = Chn[i].nRightVol = 0; - Chn[i].nNewLeftVol = Chn[i].nNewRightVol = 0; - Chn[i].nLeftRamp = Chn[i].nRightRamp = 0; - Chn[i].nVolume = 256; - if (i < MAX_BASECHANNELS) - { - Chn[i].dwFlags = ChnSettings[i].dwFlags; - Chn[i].nPan = ChnSettings[i].nPan; - Chn[i].nGlobalVol = ChnSettings[i].nVolume; - } else - { - Chn[i].dwFlags = 0; - Chn[i].nPan = 128; - Chn[i].nGlobalVol = 64; - } - } m_nGlobalVolume = m_nDefaultGlobalVolume; m_nMusicSpeed = m_nDefaultSpeed; m_nMusicTempo = m_nDefaultTempo; @@ -1382,10 +1344,11 @@ if(nch > MAX_BASECHANNELS) return true; + ResetChannelSettings(nch, CHNRESET_TOTAL); + ChnSettings[nch].nPan = 128; ChnSettings[nch].nVolume = 64; ChnSettings[nch].dwFlags = 0; - ChnSettings[nch].dwFlags &= ~CHN_MUTE; //Unmuting ChnSettings[nch].nMixPlugin = 0; ChnSettings[nch].szName[0] = 0; @@ -1401,8 +1364,74 @@ return false; } +void CSoundFile::ResetChannelSettings(CHANNELINDEX i, BYTE resetMask) +//------------------------------------------------------- +{ + //Relabs.Hack + if(i >= MAX_CHANNELS) return; + + if(resetMask & CHNRESET_BASIC) + { + if(i < MAX_BASECHANNELS) + { + //Chn[i].dwFlags = ChnSettings[i].dwFlags; + Chn[i].nPan = ChnSettings[i].nPan; + Chn[i].nGlobalVol = ChnSettings[i].nVolume; + } + else + { + Chn[i].dwFlags = 0; + Chn[i].nPan = 128; + Chn[i].nGlobalVol = 64; + } + + } + if(resetMask == CHNRESET_BASIC) return; + if(resetMask & CHNRESET_MOST) + { + Chn[i].nNote = Chn[i].nNewNote = Chn[i].nNewIns = 0; + Chn[i].pInstrument = NULL; + Chn[i].pHeader = NULL; + Chn[i].nPortamentoDest = 0; + Chn[i].nCommand = 0; + Chn[i].nPatternLoopCount = 0; + Chn[i].nPatternLoop = 0; + Chn[i].nFadeOutVol = 0; + Chn[i].dwFlags |= CHN_KEYOFF|CHN_NOTEFADE; + Chn[i].nTremorCount = 0; + } + if(resetMask == CHNRESET_MOST) return; + if(resetMask & CHNRESET_TOTAL) + { + Chn[i].nPeriod = 0; + Chn[i].nPos = Chn[i].nLength = 0; + Chn[i].nLoopStart = 0; + Chn[i].nLoopEnd = 0; + Chn[i].nROfs = Chn[i].nLOfs = 0; + Chn[i].pSample = NULL; + Chn[i].pInstrument = NULL; + Chn[i].pHeader = NULL; + Chn[i].nCutOff = 0x7F; + Chn[i].nResonance = 0; + Chn[i].nFilterMode = 0; + Chn[i].nLeftVol = Chn[i].nRightVol = 0; + Chn[i].nNewLeftVol = Chn[i].nNewRightVol = 0; + Chn[i].nLeftRamp = Chn[i].nRightRamp = 0; + Chn[i].nVolume = 256; + } +} + +void CSoundFile::ResetChannelSettings(BYTE resetMask) +//------------------------------------- +{ + for(CHANNELINDEX i = 0; i<GetNumChannels(); i++) + ResetChannelSettings(i, resetMask); +} + + + CHANNELINDEX CSoundFile::ReArrangeChannels(const std::vector<CHANNELINDEX>& newOrder) //------------------------------------------------------------------- { @@ -2799,9 +2828,47 @@ WORD CSoundFile::GetTempoMin() const {return 32;} WORD CSoundFile::GetTempoMax() const {return 512;} -ROWINDEX CSoundFile::GetRowMax() const {return MAX_PATTERN_ROWS;} -ROWINDEX CSoundFile::GetRowMin() const {return 2;} +ROWINDEX CSoundFile::GetRowMax() const +//------------------------------------ +{ + switch(m_nType) + { + case MOD_TYPE_MPT: + return MPTM_SPECS.patternRowsMax; + case MOD_TYPE_MOD: + return MOD_SPECS.patternRowsMax; + case MOD_TYPE_XM: + return XM_SPECS.patternRowsMax; + case MOD_TYPE_IT: + return IT_SPECS.patternRowsMax; + case MOD_TYPE_S3M: + return S3M_SPECS.patternRowsMax; + default: + return MAX_PATTERN_ROWS; + } +} +ROWINDEX CSoundFile::GetRowMin() const +//------------------------------------ +{ + switch(m_nType) + { + case MOD_TYPE_MPT: + return MPTM_SPECS.patternRowsMin; + case MOD_TYPE_MOD: + return MOD_SPECS.patternRowsMin; + case MOD_TYPE_XM: + return XM_SPECS.patternRowsMin; + case MOD_TYPE_IT: + return IT_SPECS.patternRowsMin; + case MOD_TYPE_S3M: + return S3M_SPECS.patternRowsMin; + default: + return 2; + } +} + + CHANNELINDEX CSoundFile::GetNumChannelMax() const //----------------------------------- { @@ -2833,3 +2900,30 @@ replace(Order.begin(), Order.end(), oldIgnoreIndex, Patterns.GetIgnoreIndex()); } +#ifndef TRADITIONAL_MODCOMMAND +void CSoundFile::OnSetEffect(MODCOMMAND& mc, EFFECT_ID eID) +//--------------------------------------------------------- +{ + // Check for MOD/XM Speed/Tempo command + if( + (GetModType() & (MOD_TYPE_MOD|MOD_TYPE_XM)) && + (eID == CMD_SPEED || eID == CMD_TEMPO) + ) + { + UINT maxspd = (GetModType() == MOD_TYPE_XM) ? 0x1F : 0x20; + mc.SetEffectByID((mc.GetEffectParam() <= maxspd) ? CMD_SPEED : CMD_TEMPO); + } + else + { + mc.SetEffectByID(eID); + } +} + + +void CSoundFile::OnSetEffectParam(MODCOMMAND& mc, EFFECT_PARAM eParam) +//--------------------------------------------------------- +{ + mc.SetEffectParam(eParam); +} + +#endif Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/soundlib/Sndfile.h 2007-04-01 00:28:16 UTC (rev 177) @@ -604,7 +604,11 @@ //<---- } MODCHANNEL; +#define CHNRESET_BASIC 1 +#define CHNRESET_MOST 3 +#define CHNRESET_TOTAL 255 + typedef struct _MODCHANNELSETTINGS { UINT nPan; @@ -802,6 +806,8 @@ CHANNELINDEX GetNumChannelMax() const; CHANNELINDEX GetNumChannelMin() const; + size_t GetModNameLengthMax() {return 25;} + public: //Misc void ChangeModTypeTo(const int& newType); // @@ -933,10 +939,12 @@ BOOL Create(LPCBYTE lpStream, CModDoc *pModDoc, DWORD dwMemLength=0); BOOL Destroy(); UINT GetType() const { return m_nType; } + + //Return the number of channels in the pattern. In 1.17.02.45 + //it returned the number of channels with volume != 0 UINT GetNumChannels() const {return m_nChannels;} - //Return the number of channels in the pattern. In 1.17.02.45 - //it returned the number of channels with volume != 0 + BOOL SetMasterVolume(UINT vol, BOOL bAdjustAGC=FALSE); UINT GetMasterVolume() const { return m_nMasterVolume; } UINT GetNumPatterns() const; @@ -978,6 +986,17 @@ CHANNELINDEX ReArrangeChannels(const std::vector<CHANNELINDEX>& fromToArray); bool MoveChannel(UINT chn_from, UINT chn_to); bool SetChannelSettingsToDefault(UINT nch); + + + //Sets default channels settings from MODCHANNELSETTINGS to current + //channel settings. Flag can be used to tell whether to completely + //reset channels, not only a few settings(for maintaining old behavior). + void ResetChannelSettings(CHANNELINDEX chn, BYTE resetStyle); + + //For all channels. + void ResetChannelSettings(BYTE resetStyle); + + // Module Loaders BOOL ReadXM(LPCBYTE lpStream, DWORD dwMemLength); BOOL ReadS3M(LPCBYTE lpStream, DWORD dwMemLength); Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -1619,6 +1619,9 @@ } if (m_pConfig->getTreatPanLikeBalance()) { + pChn->nNewLeftVol = (realvol * pan) >> 8; + pChn->nNewRightVol = (realvol * (256 - pan)) >> 8; + } else { if (pan < 128) { pChn->nNewLeftVol = (realvol * pan) >> 8; pChn->nNewRightVol = (realvol * 128) >> 8; @@ -1626,9 +1629,6 @@ pChn->nNewLeftVol = (realvol * 128) >> 8; pChn->nNewRightVol = (realvol * (256 - pan)) >> 8; } - } else { - pChn->nNewLeftVol = (realvol * pan) >> 8; - pChn->nNewRightVol = (realvol * (256 - pan)) >> 8; } } else { Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2007-04-01 00:28:16 UTC (rev 177) @@ -18,7 +18,7 @@ UINT tempoMax; UINT patternRowsMin; UINT patternRowsMax; - UINT modNameLengthMax; + UINT modNameLengthMax; //Meaning 'usable letters', possible null character is not included. UINT samplesMax; UINT instrumentsMax; }; @@ -50,32 +50,87 @@ 512, //Max tempo 2, //Min pattern rows 1024, //Max pattern rows - 100, //Max mod name length + 256, //Max mod name length 4000, //SamplesMax 256, //instrumentMax }; -/* -const CModSpecifications MOD_TYPE_MOD = + +const CModSpecifications MOD_SPECS = { - "mod", - + //TODO: Set correct values. + "mod", //File extension + 64, //Pattern max. + 128, //Order max. + 4, //Channel min + 4, //Channel max + 32, //Min tempo + 256, //Max tempo + 64, //Min pattern rows + 64, //Max pattern rows + 25, //Max mod name length + 31, //SamplesMax + 0, //instrumentMax }; -const CModSpecifications MOD_TYPE_XM = + +const CModSpecifications XM_SPECS = { - "xm", + //TODO: Set correct values. + "xm", //File extension + 64, //Pattern max. + 128, //Order max. + 4, //Channel min + 64, //Channel max + 32, //Min tempo + 256, //Max tempo + 4, //Min pattern rows + 256, //Max pattern rows + 25, //Max mod name length + 31, //SamplesMax + 256, //instrumentMax }; -const CModSpecifications MOD_TYPE_IT = +const CModSpecifications S3M_SPECS = { - "it", + //TODO: Set correct values. + "s3m", //File extension + 240, //Pattern max. + 256, //Order max. + 4, //Channel min + 32, //Channel max + 32, //Min tempo + 256, //Max tempo + 64, //Min pattern rows + 64, //Max pattern rows + 25, //Max mod name length + 31, //SamplesMax + 0, //instrumentMax }; -*/ +const CModSpecifications IT_SPECS = +{ + //TODO: Set correct values. + "it", //File extension + 240, //Pattern max. + 256, //Order max. + 4, //Channel min + 64, //Channel max + 32, //Min tempo + 256, //Max tempo + 4, //Min pattern rows + 256, //Max pattern rows + 25, //Max mod name length(in ittech.txt: "0000: \xB3'I'\xB3'M'\xB3'P'\xB3'M'\xB3 Song Name, max 26 characters, includes NULL \xB3") + 256, //SamplesMax + 256, //instrumentMax +}; + + + + #endif Modified: trunk/OpenMPT/soundlib/tuning.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuning.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/soundlib/tuning.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -8,8 +8,14 @@ //CTuningRTi-statics const CTuning::SERIALIZATION_MARKER CTuningRTI::s_SerializationBeginMarker("CTRTI_B."); const CTuning::SERIALIZATION_MARKER CTuningRTI::s_SerializationEndMarker("CTRTI_E."); -const CTuning::SERIALIZATION_VERSION CTuningRTI::s_SerializationVersion(2); +const CTuning::SERIALIZATION_VERSION CTuningRTI::s_SerializationVersion(3); +/* +Version changes: + 2->3: The type for the size_type in the serialisation changed + from default(size_t, uint64) to unsigned STEPTYPE. (March 2007) +*/ + //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// @@ -178,11 +184,12 @@ if(CTuning::SerializeBinary(outStrm) == SERIALIZATION_FAILURE) return SERIALIZATION_FAILURE; //Main Ratios - if(VectorToBinaryStream(outStrm, m_RatioTable)) + if(VectorToBinaryStream<RATIOTYPE, USTEPTYPE>(outStrm, m_RatioTable)) return SERIALIZATION_FAILURE; + //Fine ratios - if(VectorToBinaryStream(outStrm, m_RatioTableFine)) + if(VectorToBinaryStream<RATIOTYPE, UFINESTEPTYPE>(outStrm, m_RatioTableFine)) return SERIALIZATION_FAILURE; //m_StepMin @@ -235,7 +242,7 @@ //Version inStrm.read(reinterpret_cast<char*>(&version), sizeof(version)); - if(version != 1 && version != s_SerializationVersion) + if(version > s_SerializationVersion) return SERIALIZATION_FAILURE; //Baseclass Unserialization @@ -243,14 +250,31 @@ return SERIALIZATION_FAILURE; //Ratiotable - if(VectorFromBinaryStream(inStrm, m_RatioTable)) - return SERIALIZATION_FAILURE; + if(version < 3) + { + if(VectorFromBinaryStream<RATIOTYPE, uint64>(inStrm, m_RatioTable)) + return SERIALIZATION_FAILURE; + } + else //Version >= 3 + { + if(VectorFromBinaryStream<RATIOTYPE, USTEPTYPE>(inStrm, m_RatioTable)) + return SERIALIZATION_FAILURE; + } + //Ratiotable fine if(version > 1) { - if(VectorFromBinaryStream(inStrm, m_RatioTableFine)) - return SERIALIZATION_FAILURE; + if(version < 3) + { + if(VectorFromBinaryStream<RATIOTYPE, uint64>(inStrm, m_RatioTableFine)) + return SERIALIZATION_FAILURE; + } + else //Version >= 3 + { + if(VectorFromBinaryStream<RATIOTYPE, UFINESTEPTYPE>(inStrm, m_RatioTableFine)) + return SERIALIZATION_FAILURE; + } } Modified: trunk/OpenMPT/soundlib/tuningCollection.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuningCollection.cpp 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/soundlib/tuningCollection.cpp 2007-04-01 00:28:16 UTC (rev 177) @@ -5,8 +5,15 @@ //Serializations statics: const CTuningCollection::SERIALIZATION_MARKER CTuningCollection::s_SerializationBeginMarker = 0x54435348; //ascii of TCSH(TuningCollectionSerialisationHeader) in hex. const CTuningCollection::SERIALIZATION_MARKER CTuningCollection::s_SerializationEndMarker = 0x54435346; //ascii of TCSF(TuningCollectionSerialisationFooter) in hex. -const CTuningCollection::SERIALIZATION_MARKER CTuningCollection::s_SerializationVersion = 1; +const CTuningCollection::SERIALIZATION_MARKER CTuningCollection::s_SerializationVersion = 2; +/* +Version history: + 1->2: Sizetypes of string serialisation from size_t(uint64) + to uint8. (March 2007) +*/ + + const CTuningCollection::SERIALIZATION_RETURN_TYPE CTuningCollection::SERIALIZATION_SUCCESS = false; const CTuningCollection::SERIALIZATION_RETURN_TYPE CTuningCollection::SERIALIZATION_FAILURE = true; @@ -29,6 +36,7 @@ CTuningCollection::CTuningCollection(const string& name) : m_Name(name) //------------------------------------ { + if(m_Name.size() > GetNameLengthMax()) m_Name.resize(GetNameLengthMax()); m_EditMask.set(); } @@ -132,7 +140,7 @@ outStrm.write(reinterpret_cast<const char*>(&s_SerializationVersion), sizeof(s_SerializationVersion)); //3. Name - if(StringToBinaryStream(outStrm, m_Name)) + if(StringToBinaryStream<uint8>(outStrm, m_Name)) return SERIALIZATION_FAILURE; //4. Edit mask @@ -202,11 +210,19 @@ //2. Serialization version inStrm.read(reinterpret_cast<char*>(&version), sizeof(version)); - if(version != s_SerializationVersion) return SERIALIZATION_FAILURE; + if(version > s_SerializationVersion) return SERIALIZATION_FAILURE; //3. Name - if(StringFromBinaryStream(inStrm, m_Name)) - return SERIALIZATION_FAILURE; + if(version < 2) + { + if(StringFromBinaryStream<uint64>(inStrm, m_Name)) + return SERIALIZATION_FAILURE; + } + else + { + if(StringFromBinaryStream<uint8>(inStrm, m_Name)) + return SERIALIZATION_FAILURE; + } //4. Editmask __int16 em = 0; Modified: trunk/OpenMPT/soundlib/tuning_template.h =================================================================== --- trunk/OpenMPT/soundlib/tuning_template.h 2007-03-14 01:04:11 UTC (rev 176) +++ trunk/OpenMPT/soundlib/tuning_template.h 2007-04-01 00:28:16 UTC (rev 177) @@ -68,7 +68,9 @@ */ //Class defining tuning which is fundamentally based on discrete steps. -template<class TSTEPTYPE = short int, class TRATIOTYPE = float, class TFINESTEPTYPE = TSTEPTYPE> +template<class TSTEPTYPE = short int, class TUSTEPTYPE = unsigned short int, + class TRATIOTYPE = float, + class TFINESTEPTYPE = TSTEPTYPE, class TUFINESTEPTYPE = TUSTEPTYPE> class CTuningBase { //STEPTYPE: Some type that has properties that of 'ordinary' signed and discrete figures. @@ -81,8 +83,10 @@ public: //BEING TYPEDEFS: typedef TSTEPTYPE STEPTYPE; + typedef TUSTEPTYPE USTEPTYPE; //Unsigned steptype typedef TRATIOTYPE RATIOTYPE; typedef TFINESTEPTYPE FINESTEPTYPE; + typedef TUFINESTEPTYPE UFINESTEPTYPE; //Unsigned finesteptype typedef std::exception TUNINGEXCEPTION; @@ -103,6 +107,7 @@ typedef std::string NOTESTR; typedef std::map<STEPTYPE, NOTESTR> NOTENAMEMAP; + typedef USTEPTYPE SIZETYPE; typedef typename NOTENAMEMAP::iterator NNM_ITER; typedef typename NOTENAMEMAP::const_iterator NNM_CITER; @@ -277,7 +282,8 @@ CTuningBase& operator=(const CTuningBase&); CTuningBase(const CTuningBase&); //When copying tunings, the name must not be exact copy - //since it is to be unique for every tuning. + //since it is to be unique for every tuning, or maybe some + //better identification could be introduced. CTUNINGTYPE GetType() const {return m_TuningType;} @@ -288,7 +294,7 @@ //BEGIN PRIVATE METHODS private: SERIALIZATION_RETURN_TYPE NotenameMapToBinary(ostream&) const; - SERIALIZATION_RETURN_TYPE NotenameMapFromBinary(istream&); + SERIALIZATION_RETURN_TYPE NotenameMapFromBinary(istream&, const SERIALIZATION_VERSION); bool SetType(const CTUNINGTYPE& tt) { @@ -342,63 +348,64 @@ //Specialising tuning for ompt. -typedef short int MPT_TUNING_STEPTYPE; -typedef float MPT_TUNING_RATIOTYPE; -typedef MPT_TUNING_STEPTYPE MPT_TUNING_FINESTEPTYPE; +typedef CTuningBase<int16, uint16, float32, int16, uint16> CTuning; -typedef CTuningBase<MPT_TUNING_STEPTYPE, MPT_TUNING_RATIOTYPE, MPT_TUNING_FINESTEPTYPE> CTuning; - const CTuning::SERIALIZATION_MARKER CTuning::s_SerializationBeginMarker("CT<sfs>B"); const CTuning::SERIALIZATION_MARKER CTuning::s_SerializationEndMarker("CT<sfs>E"); //<sfs> <-> Short Float Short -template<class A, class B, class C> -const CTuningBase<>::SERIALIZATION_MARKER CTuningBase<A, B, C>::s_SerializationBeginMarker("CTB<ABC>"); +template<class A, class B, class C, class D, class E> +const CTuningBase<>::SERIALIZATION_MARKER CTuningBase<A, B, C, D, E>::s_SerializationBeginMarker("CTB<ABC>"); -template<class A, class B, class C> -const CTuningBase<>::SERIALIZATION_MARKER CTuningBase<A, B, C>::s_SerializationEndMarker("CTB<ABC>"); +template<class A, class B, class C, class D, class E> +const CTuningBase<>::SERIALIZATION_MARKER CTuningBase<A, B, C, D, E>::s_SerializationEndMarker("CTB<ABC>"); -template<class A, class B, class C> -const CTuningBase<>::SERIALIZATION_VERSION CTuningBase<A, B, C>::s_SerializationVersion(3); +template<class A, class B, class C, class D, class E> +const CTuningBase<>::SERIALIZATION_VERSION CTuningBase<A, B, C, D, E>::s_SerializationVersion(4); +/* +Version history: + 3->4: Changed sizetypes in serialisation from size_t(uint64) to + smaller types (uint8, USTEPTYPE) (March 2007) +*/ -template<class A, class B, class C> -const CTuningBase<>::SERIALIZATION_RETURN_TYPE CTuningBase<A, B, C>::SERIALIZATION_SUCCESS = false; +template<class A, class B, class C, class D, class E> +const CTuningBase<>::SERIALIZATION_RETURN_TYPE CTuningBase<A, B, C, D, E>::SERIALIZATION_SUCCESS = false; -template<class A, class B, class C> -const CTuningBase<>::SERIALIZATION_RETURN_TYPE CTuningBase<A, B, C>::SERIALIZATION_FAILURE = true; +template<class A, class B, class C, class D, class E> +const CTuningBase<>::SERIALIZATION_RETURN_TYPE CTuningBase<A, B, C, D, E>::SERIALIZATION_FAILURE = true; -template<class A, class B, class C> -const string CTuningBase<A, B, C>::s_FileExtension = ".tun"; +template<class A, class B, class C, class D, class E> +const string CTuningBase<A, B, C, D, E>::s_FileExtension = ".tun"; -template<class A, class B, class C> -const CTuning::CEDITMASK CTuningBase<A, B, C>::EM_MAINRATIOS = 0x1; //1b -template<class A, class B, class C> -const CTuning::CEDITMASK CTuningBase<A, B, C>::EM_NOTENAME = 0x2; //10b -template<class A, class B, class C> -const CTuning::CEDITMASK CTuningBase<A, B, C>::EM_TYPE = 0x4; //100b -template<class A, class B, class C> -const CTuning::CEDITMASK CTuningBase<A, B, C>::EM_NAME = 0x8; //1000b -template<class A, class B, class C> -const CTuning::CEDITMASK CTuningBase<A, B, C>::EM_FINETUNE = 0x10; //10000b -template<class A, class B, class C> -const CTuning::CEDITMASK CTuningBase<A, B, C>::EM_ALLOWALL = 0xFFFF; //All editing allowed. -template<class A, class B, class C> -const CTuning::CEDITMASK CTuningBase<A, B, C>::EM_EDITMASK = 0x8000; //Whether to allow modifications to editmask. -template<class A, class B, class C> -const CTuning::CEDITMASK CTuningBase<A, B, C>::EM_CONST = 0x8000; //All editing except changing const status disable. -template<class A, class B, class C> -const CTuning::CEDITMASK CTuningBase<A, B, C>::EM_CONST_STRICT = 0; //All bits are zero. +template<class A, class B, class C, class D, class E> +const CTuning::CEDITMASK CTuningBase<A, B, C, D, E>::EM_MAINRATIOS = 0x1; //1b +template<class A, class B, class C, class D, class E> +const CTuning::CEDITMASK CTuningBase<A, B, C, D, E>::EM_NOTENAME = 0x2; //10b +template<class A, class B, class C, class D, class E> +const CTuning::CEDITMASK CTuningBase<A, B, C, D, E>::EM_TYPE = 0x4; //100b +template<class A, class B, class C, class D, class E> +const CTuning::CEDITMASK CTuningBase<A, B, C, D, E>::EM_NAME = 0x8; //1000b +template<class A, class B, class C, class D, class E> +const CTuning::CEDITMASK CTuningBase<A, B, C, D, E>::EM_FINETUNE = 0x10; //10000b +template<class A, class B, class C, class D, class E> +const CTuning::CEDITMASK CTuningBase<A, B, C, D, E>::EM_ALLOWALL = 0xFFFF; //All editing allowed. +template<class A, class B, class C, class D, class E> +const CTuning::CEDITMASK CTuningBase<A, B, C, D, E>::EM_EDITMASK = 0x8000; //Whether to allow modifications to editmask. +template<class A, class B, class C, class D, class E> +const CTuning::CEDITMASK CTuningBase<A, B, C, D, E>::EM_CONST = 0x8000; //All editing except changing const status disable. +template<class A, class B, class C, class D, class E> +const CTuning::CEDITMASK CTuningBase<A, B, C, D, E>::EM_CONST_STRICT = 0; //All bits are zero. -template<class A, class B, class C> -const CTuning::CTUNINGTYPE CTuningBase<A, B, C>::TT_GENERAL = 0; //0...00b -template<class A, class B, class C> -const CTuning::CTUNINGTYPE CTuningBase<A, B, C>::TT_RATIOPERIODIC = 1; //0...10b -template<class A, class B, class C> -const CTuning::CTUNINGTYPE CTuningBase<A, B, C>::TT_TET = 3; //0...11b +template<class A, class B, class C, class D, class E> +const CTuning::CTUNINGTYPE CTuningBase<A, B, C, D, E>::TT_GENERAL = 0; //0...00b +template<class A, class B, class C, class D, class E> +const CTuning::CTUNINGTYPE CTuningBase<A, B, C, D, E>::TT_RATIOPERIODIC = 1; //0...10b +template<class A, class B, class C, class D, class E> +const CTuning::CTUNINGTYPE CTuningBase<A, B, C, D, E>::TT_TET = 3; //0...11b -template<class A, class B, class C> -CTuningBase<A,B,C>& CTuningBase<A,B,C>::operator =(const CTuningBase& pt) +template<class A, class B, class C, class D, class E> +CTuningBase<A,B,C,D,E>& CTuningBase<A,B,C,D,E>::operator =(const CTuningBase& pt) //----------------------------------------------------------------------- { if(!MayEdit(EM_ALLOWALL)) @@ -437,15 +444,15 @@ return *this; } -template<class A, class B, class C> -CTuningBase<A,B,C>::CTuningBase(const CTuningBase& pt) +template<class A, class B, class C, class D, class E> +CTuningBase<A,B,C,D,E>::CTuningBase(const CTuningBase& pt) //----------------------------------------------------------------------- { *this = pt; } -template<class A, class B, class C> -bool CTuningBase<A,B,C>::SetRatio(const STEPTYPE& s, const RATIOTYPE& r) +template<class A, class B, class C, class D, class E> +bool CTuningBase<A,B,C,D,E>::SetRatio(const STEPTYPE& s, const RATIOTYPE& r) //----------------------------------------------------------------- { if(MayEdit(EM_MAINRATIOS)) @@ -461,8 +468,8 @@ } -template<class A, class B, class C> -string CTuningBase<A,B,C>::GetTuningTypeStr(const CTUNINGTYPE& tt) +template<class A, class B, class C, class D, class E> +string CTuningBase<A,B,C,D,E>::GetTuningTypeStr(const CTUNINGTYPE& tt) //---------------------------------------------------------------- { if(tt == TT_GENERAL) @@ -476,8 +483,8 @@ -template<class A, class B, class C> -CTuningBase<>::NOTESTR CTuningBase<A,B,C>::GetNoteName(const STEPTYPE& x) const +template<class A, class B, class C, class D, class E> +CTuningBase<>::NOTESTR CTuningBase<A,B,C,D,E>::GetNoteName(const STEPTYPE& x) const //----------------------------------------------------------------------- { NNM_CITER i = m_NoteNameMap.find(x); @@ -488,8 +495,8 @@ } -template<class A, class B, class C> -bool CTuningBase<A,B,C>::DoesTypeInclude(const CTUNINGTYPE& type) const +template<class A, class B, class C, class D, class E> +bool CTuningBase<A,B,C,D,E>::DoesTypeInclude(const CTUNINGTYPE& type) const //----------------------------------------------------------------------------- { if(type == TT_GENERAL) @@ -508,8 +515,8 @@ return false; } -template<class A, class B, class C> -bool CTuningBase<A,B,C>::SetNoteName(const STEPTYPE& n, const string& str) +template<class A, class B, class C, class D, class E> +bool CTuningBase<A,B,C,D,E>::SetNoteName(const STEPTYPE& n, const string& str) //----------------------------------------------------------------------- { if(MayEdit(EM_NOTENAME)) @@ -520,8 +527,8 @@ return true; } -template<class A, class B, class C> -bool CTuningBase<A,B,C>::ClearNoteName(const STEPTYPE& n, const bool eraseAll) +template<class A, class B, class C, class D, class E> +bool CTuningBase<A,B,C,D,E>::ClearNoteName(const STEPTYPE& n, const bool eraseAll) //------------------------------------------------------- { if(MayEdit(EM_NOTENAME)) @@ -545,8 +552,8 @@ } -template<class A, class B, class C> -bool CTuningBase<A,B,C>::Multiply(const RATIOTYPE& r) +template<class A, class B, class C, class D, class E> +bool CTuningBase<A,B,C,D,E>::Multiply(const RATIOTYPE& r) //--------------------------------------------------- { if(r <= 0 || !MayEdit(EM_MAINRATIOS)) @@ -563,8 +570,8 @@ return false; } -template<class A, class B, class C> -bool CTuningBase<A,B,C>::CreateRatioPeriodic(const STEPTYPE& s, const RATIOTYPE& r) +template<class A, class B, class C, class D, class E> +bool CTuningBase<A,B,C,D,E>::CreateRatioPeriodic(const STEPTYPE& s, const RATIOTYPE& r) //------------------------------------------------------------- { if(s < 1 || r <= 0) @@ -577,8 +584,8 @@ return CreateRatioPeriodic(v, r); } -template<class A, class B, class C> -bool CTuningBase<A,B,C>::CreateRatioPeriodic(const vector<RATIOTYPE>& v, const RATIOTYPE& r) +template<class A, class B, class C, class D, class E> +bool CTuningBase<A,B,C,D,E>::CreateRatioPeriodic(const vector<RATIOTYPE>& v, const RATIOTYPE& r) //------------------------------------------------------------------------------------------ { if(MayEdit(EM_MAINRATIOS) && @@ -599,8 +606,8 @@ } -template<class A, class B, class C> -bool CTuningBase<A,B,C>::CreateTET(const STEPTYPE& s, const RATIOTYPE& r) +template<class A, class B, class C, class D, class E> +bool CTuningBase<A,B,C,D,E>::CreateTET(const STEPTYPE& s, const RATIOTYPE& r) //------------------------------------------------------------------- { if(MayEdit(EM_MAINRATIOS) && @@ -621,8 +628,8 @@ } -template<class A, class B, class C> -bool CTuningBase<A,B,C>::ChangePeriod(const STEPTYPE& s) +template<class A, class B, class C, class D, class E> +bool CTuningBase<A,B,C,D,E>::ChangePeriod(const STEPTYPE& s) //--------------------------------------------------- { if(!MayEdit(EM_MAINRATIOS) || s < 1) @@ -638,8 +645,8 @@ } -template<class A, class B, class C> -bool CTuningBase<A,B,C>::ChangePeriodRatio(const RATIOTYPE& r) +template<class A, class B, class C, class D, class E> +bool CTuningBase<A,B,C,D,E>::ChangePeriodRatio(const RATIOTYPE& r) //--------------------------------------------------- { if(!MayEdit(EM_MAINRATIOS) || r <= 0) @@ -655,8 +662,8 @@ } -template<class TSTEPTYPE, class TRATIOTYPE, class TFINESTEPTYPE> -CTuningBase<>::SERIALIZATION_RETURN_TYPE CTuningBase<TSTEPTYPE, TRATIOTYPE, TFINESTEPTYPE>::SerializeBinary(ostream& outStrm, const int mode) const +template<class A, class B, class C, class D, class E> +CTuningBase<>::SERIALIZATION_RETURN_TYPE CTuningBase<A, B, C, D, E>::SerializeBinary(ostream& outStrm, const int mode) const //------------------------------------------------------------------------------------------------------------------------------ { //Writing the tuning name here. @@ -667,7 +674,7 @@ outStrm.write(reinterpret_cast<const char*>(&s_SerializationVersion), sizeof(s_SerializationVersion)); //Tuning name - if(StringToBinaryStream(outStrm, m_TuningName)) return SERIALIZATION_FAILURE; + if(StringToBinaryStream<uint8>(outStrm, m_TuningName)) return SERIALIZATION_FAILURE; //Const mask const __int16 cm = static_cast<__int16>(m_EditMask.to_ulong()); @@ -693,8 +700,8 @@ } -template<class TSTEPTYPE, class TRATIOTYPE, class TFINESTEPTYPE> -CTuningBase<>::SERIALIZATION_RETURN_TYPE CTuningBase<TSTEPTYPE, TRATIOTYPE, TFINESTEPTYPE>::UnSerializeBinary(istream& inStrm, const int mode) +template<class A, class B, class C, class D, class E> +CTuningBase<>::SERIALIZATION_RETURN_TYPE CTuningBase<A,B,C,D,E>::UnSerializeBinary(istream& inStrm,... [truncated message content] |
From: <rel...@us...> - 2007-04-13 22:43:47
|
Revision: 178 http://svn.sourceforge.net/modplug/?rev=178&view=rev Author: relabsoluness Date: 2007-04-13 15:43:39 -0700 (Fri, 13 Apr 2007) Log Message: ----------- . v1.17.02.46 (Still no binaries) + <Relabs> Time calculator for pattern rows using existing modlength calculator function. . <Relabs> The songtitle limit in general tab should now work properly for every format. / <Relabs> Various minor modifications. Modified Paths: -------------- trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_gen.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/pattern.h trunk/OpenMPT/mptrack/patternContainer.h trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/mptrack/typedefs.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2007-04-13 22:43:39 UTC (rev 178) @@ -2268,6 +2268,11 @@ commands[kcSoloChnOnPatTransition].isDummy = false; commands[kcSoloChnOnPatTransition].Message = "Solo channel on pattern transition"; + commands[kcTimeAtRow].UID = 1780; + commands[kcTimeAtRow].isHidden = false; + commands[kcTimeAtRow].isDummy = false; + commands[kcTimeAtRow].Message = "Show playback time at current row"; + #ifdef _DEBUG for (int i=0; i<kcNumCommands; i++) { if (commands[i].UID != 0) { // ignore unset UIDs Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/CommandSet.h 2007-04-13 22:43:39 UTC (rev 178) @@ -220,7 +220,8 @@ kcShowMacroConfig, kcChangeLoopStatus, kcShowEditMenu, - kcEndPatternEditMisc=kcShowEditMenu, + kcTimeAtRow, + kcEndPatternEditMisc=kcTimeAtRow, kcChannelMute, kcChannelSolo, Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2007-04-13 22:43:39 UTC (rev 178) @@ -11,6 +11,7 @@ // -> CODE#0015 // -> DESC="channels management dlg" #include "Ctrl_pat.h" +#include ".\ctrl_gen.h" // -! NEW_FEATURE#0015 BEGIN_MESSAGE_MAP(CCtrlGeneral, CModControlDlg) @@ -33,6 +34,7 @@ ON_EN_CHANGE(IDC_EDIT_SAMPLEPA, OnSamplePAChanged) ON_CBN_SELCHANGE(IDC_COMBO_RESAMPLING, OnResamplingChanged) ON_MESSAGE(WM_MOD_UPDATEPOSITION, OnUpdatePosition) + ON_EN_SETFOCUS(IDC_EDIT_SONGTITLE, OnEnSetfocusEditSongtitle) //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -83,7 +85,7 @@ if(m_pSndFile) m_EditTitle.SetLimitText(m_pSndFile->GetModNameLengthMax()); else - m_EditTitle.SetLimitText(31); + m_EditTitle.SetLimitText(25); // -> CODE#0016 // -> DESC="default tempo update" @@ -302,20 +304,15 @@ void CCtrlGeneral::OnTitleChanged() //--------------------------------- { - CHAR s[35]; if ((!m_pSndFile) || (!m_EditTitle.m_hWnd) || (!m_EditTitle.GetModify())) return; - memset(s, 0, sizeof(s)); - m_EditTitle.GetWindowText(s, sizeof(s)); - s[25] = 0; - if (strcmp(m_pSndFile->m_szNames[0], s)) + + CString title; + m_EditTitle.GetWindowText(title); + if(m_pSndFile->SetTitle(title, title.GetLength()) && m_pModDoc) { - memcpy(m_pSndFile->m_szNames[0], s, 26); - if (m_pModDoc) - { - m_EditTitle.SetModify(FALSE); - m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); - } + m_EditTitle.SetModify(FALSE); + m_pModDoc->SetModified(); + m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); } } @@ -661,7 +658,17 @@ } +void CCtrlGeneral::OnEnSetfocusEditSongtitle() +//-------------------------------------------- +{ + if(m_pSndFile) + { + m_EditTitle.SetLimitText(m_pSndFile->GetModNameLengthMax()); + } +} + + //////////////////////////////////////////////////////////////////////////////// // // CVuMeter Modified: trunk/OpenMPT/mptrack/Ctrl_gen.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.h 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/Ctrl_gen.h 2007-04-13 22:43:39 UTC (rev 178) @@ -82,6 +82,7 @@ afx_msg void OnReverbChanged(); afx_msg void OnSurroundChanged(); afx_msg void OnEqualizerChanged(); + afx_msg void OnEnSetfocusEditSongtitle(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2007-04-13 22:43:39 UTC (rev 178) @@ -1923,7 +1923,7 @@ //---------------------------------- { CHAR s[256]; - DWORD dwSongLength = m_SndFile.GetLength(FALSE, TRUE); + DWORD dwSongLength = m_SndFile.GetSongTime(); wsprintf(s, "Approximate song length: %dmn%02ds", dwSongLength/60, dwSongLength%60); CMainFrame::GetMainFrame()->MessageBox(s, NULL, MB_OK|MB_ICONINFORMATION); } Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2007-04-13 22:43:39 UTC (rev 178) @@ -13,7 +13,7 @@ #include "CreditStatic.h" #include "hyperEdit.h" #include "bladedll.h" -#include "commctrl.h"; +#include "commctrl.h" // rewbs.memLeak #define CRTDBG_MAP_ALLOC @@ -1382,7 +1382,7 @@ m_bmp.LoadBitmap(MAKEINTRESOURCE(IDB_MPTRACK)); wsprintf(s, "Build Date: %s", buildDateTime.c_str()); SetDlgItemText(IDC_EDIT2, s); - SetDlgItemText(IDC_EDIT3, CMainFrame::GetFullVersionString()); + SetDlgItemText(IDC_EDIT3, CString("Open Modplug Tracker, version ") + CMainFrame::GetFullVersionString()); m_heContact.SetWindowText( "Contact:\r\n\ @@ -1398,7 +1398,7 @@ "|" "Development:|" "Robin Fernandes: mo...@so... (2004-2006)|" - "Relabsoluness: lk...@me... (2005-2006)|" + "rel...@us... (2005-2006)|" "Eric Chavanon: co...@er... (2004-2005)|" "Trevor Nunes: mo...@pl... (2004)|" "Olivier Lapicque: ol...@mo... (1997-2003)|" Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2007-04-13 22:43:39 UTC (rev 178) @@ -104,10 +104,12 @@ ON_COMMAND(ID_CURSORPASTE, OnCursorPaste) ON_COMMAND(ID_PATTERN_AMPLIFY, OnPatternAmplify) ON_COMMAND(ID_CLEAR_SELECTION, OnClearSelectionFromMenu) + ON_COMMAND(ID_SHOWTIMEATROW, OnShowTimeAtRow) ON_COMMAND_RANGE(ID_CHANGE_INSTRUMENT, ID_CHANGE_INSTRUMENT+MAX_INSTRUMENTS, OnSelectInstrument) ON_UPDATE_COMMAND_UI(ID_EDIT_UNDO, OnUpdateUndo) ON_COMMAND_RANGE(ID_PLUGSELECT, ID_PLUGSELECT+MAX_MIXPLUGINS, OnSelectPlugin) //rewbs.patPlugName + //}}AFX_MSG_MAP ON_WM_INITMENU() ON_WM_RBUTTONDBLCLK() @@ -1151,7 +1153,7 @@ BuildPluginCtxMenu(hMenu, nChn, pSndFile); } - //------ Header Menu ---------- : + //------ Channel Header Menu ---------- : else if (pt.y <= m_szHeader.cy){ if (ih->ShiftPressed()) { //Don't bring up menu if shift is pressed, else we won't get button up msg. @@ -1183,7 +1185,10 @@ AppendMenu(hMenu, MF_SEPARATOR, 0, ""); if (BuildGrowShrinkCtxMenu(hMenu, ih)) AppendMenu(hMenu, MF_SEPARATOR, 0, ""); + if(BuildMiscCtxMenu(hMenu, ih)) + AppendMenu(hMenu, MF_SEPARATOR, 0, ""); BuildRowInsDelCtxMenu(hMenu, ih); + } ClientToScreen(&pt); @@ -3154,6 +3159,7 @@ case kcChannelUnmuteAll: OnUnmuteAll(); return wParam; case kcToggleChanMuteOnPatTransition: TogglePendingMute((m_dwCursor&0xFFFF)>>3); return wParam; case kcUnmuteAllChnOnPatTransition: OnPendingUnmuteAllChnFromClick(); return wParam; + case kcTimeAtRow: OnShowTimeAtRow(); return wParam; case kcSoloChnOnPatTransition: PendingSoloChn(GetCurrentChannel()); return wParam; case kcTransposeUp: OnTransposeUp(); return wParam; case kcTransposeDown: OnTransposeDown(); return wParam; @@ -4442,6 +4448,16 @@ return true; } +bool CViewPattern::BuildMiscCtxMenu(HMENU hMenu, CInputHandler* ih) +//----------------------------------------------------------------- +{ + if (CMainFrame::m_dwPatternSetup & PATTERN_OLDCTXMENUSTYLE) return false; + + AppendMenu(hMenu, MF_STRING, ID_SHOWTIMEATROW, "Show row play time\t" + ih->GetKeyTextFromCommand(kcTimeAtRow)); + return true; + +} + bool CViewPattern::BuildSelectionCtxMenu(HMENU hMenu, CInputHandler* ih) //---------------------------------------------------------------------- { @@ -4842,4 +4858,32 @@ } +void CViewPattern::OnShowTimeAtRow() +//---------------------------------- +{ + CModDoc* pModDoc = GetDocument(); + CSoundFile* pSndFile = (pModDoc) ? pModDoc->GetSoundFile() : 0; + if(!pSndFile) return; + CString msg; + ORDERINDEX currentOrder = SendCtrlMessage(CTRLMSG_GETCURRENTORDER); + if(pSndFile->Order[currentOrder] == m_nPattern) + { + double t = pSndFile->GetPlaybackTimeAt(currentOrder, m_nRow); + if(t < 0) + msg.Format("Unable to determine the time. Possible cause: No order %d, row %d found from play sequence", currentOrder, m_nRow); + else + { + const uint32 minutes = static_cast<uint32>(t/60); + const float seconds = t - minutes*60; + msg.Format("Estimate for playback time at order %d(pattern %d), row %d: %d minute(s) %.2f seconds", currentOrder, m_nPattern, m_nRow, minutes, seconds); + } + } + else + msg.Format("Unable to determine the time: pattern at current order(=%d) does not correspond to pattern at pattern view(=pattern %d).", currentOrder, m_nPattern); + + MessageBox(msg); +} + + + Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/View_pat.h 2007-04-13 22:43:39 UTC (rev 178) @@ -291,6 +291,7 @@ afx_msg void OnClearSelectionFromMenu(); afx_msg void OnSelectInstrument(UINT nid); afx_msg void OnRunScript(); + afx_msg void OnShowTimeAtRow(); //}}AFX_MSG DECLARE_MESSAGE_MAP() @@ -305,6 +306,7 @@ bool BuildRecordCtxMenu(HMENU hMenu, UINT nChn, CModDoc* pModDoc); bool BuildSoloMuteCtxMenu(HMENU hMenu, CInputHandler* ih, UINT nChn, CSoundFile* pSndFile); bool BuildRowInsDelCtxMenu(HMENU hMenu, CInputHandler* ih); + bool BuildMiscCtxMenu(HMENU hMenu, CInputHandler* ih); bool BuildSelectionCtxMenu(HMENU hMenu, CInputHandler* ih); bool BuildGrowShrinkCtxMenu(HMENU hMenu, CInputHandler* ih); bool BuildNoteInterpolationCtxMenu(HMENU hMenu, CInputHandler* ih, CSoundFile* pSndFile); Modified: trunk/OpenMPT/mptrack/pattern.h =================================================================== --- trunk/OpenMPT/mptrack/pattern.h 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/pattern.h 2007-04-13 22:43:39 UTC (rev 178) @@ -8,8 +8,6 @@ class CPatternContainer; -typedef size_t ROWINDEX; -typedef size_t CHANNELINDEX; //============ class CPattern Modified: trunk/OpenMPT/mptrack/patternContainer.h =================================================================== --- trunk/OpenMPT/mptrack/patternContainer.h 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/patternContainer.h 2007-04-13 22:43:39 UTC (rev 178) @@ -18,7 +18,6 @@ //BEGIN: TYPEDEFS public: typedef vector<MODPATTERN> PATTERNVECTOR; - typedef UINT PATTERNINDEX; //END: TYPEDEFS Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/resource.h 2007-04-13 22:43:39 UTC (rev 178) @@ -969,6 +969,7 @@ #define ID_MOVETUNING 36025 #define ID_COPYTUNING 36026 #define ID_REMOVETUNINGCOLLECTION 36027 +#define ID_SHOWTIMEATROW 36028 #define ID_SELECTINST 36100 #define ID_NETLINK_MPTFR 37001 #define ID_PLUG_RECORDAUTOMATION 37003 Modified: trunk/OpenMPT/mptrack/typedefs.h =================================================================== --- trunk/OpenMPT/mptrack/typedefs.h 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/mptrack/typedefs.h 2007-04-13 22:43:39 UTC (rev 178) @@ -1,6 +1,8 @@ #ifndef TYPEDEFS_H #define TYPEDEFS_H +#include <limits> + #ifdef WIN32 typedef __int8 int8; typedef __int16 int16; @@ -13,7 +15,18 @@ typedef size_t uint64; typedef float float32; +#endif //End WIN32 specific. -#endif +typedef uint32 ROWINDEX; +typedef uint16 CHANNELINDEX; +typedef uint16 ORDERINDEX; +typedef uint16 PATTERNINDEX; +typedef uint16 TEMPO; +typedef uint16 SAMPLEINDEX; +typedef uint16 INSTRUMENTINDEX; +const ORDERINDEX ORDERINDEX_MAX = (std::numeric_limits<ORDERINDEX>::max)(); +const ROWINDEX ROWINDEX_MAX = (std::numeric_limits<ROWINDEX>::max)(); + + #endif Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2007-04-13 22:43:39 UTC (rev 178) @@ -250,6 +250,7 @@ memcpy(&id,lpStream+streamPos,sizeof(DWORD)); if(id != 0x2e697470) return FALSE; // .itp + m_nType = MOD_TYPE_IT; streamPos += sizeof(DWORD); memcpy(&id,lpStream+streamPos,sizeof(DWORD)); @@ -264,9 +265,10 @@ streamPos += sizeof(DWORD); // name string - if (streamPos+len<=dwMemLength && len<=MAX_SAMPLES*32) { - memcpy(&m_szNames[0],lpStream+streamPos,len); + if (streamPos+len<=dwMemLength && len<=sizeof(m_szNames[0])) { + memcpy(m_szNames[0],lpStream+streamPos,len); streamPos += len; + m_szNames[0][sizeof(m_szNames[0])-1] = '\0'; } // Song comments @@ -654,7 +656,8 @@ } // Leave - m_nType = MOD_TYPE_IT; + //m_nType = MOD_TYPE_IT; Relabs.note: Moved to the beginning of loading(April 2007) + m_nMaxPeriod = 0xF000; m_nMinPeriod = 8; @@ -1215,6 +1218,7 @@ // -> CODE#0023 // -> DESC="IT project files (.itp)" BOOL CSoundFile::SaveITProject(LPCSTR lpszFileName) +//------------------------------------------------- { // Check song type Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2007-04-13 22:43:39 UTC (rev 178) @@ -71,7 +71,14 @@ } */ -DWORD CSoundFile::GetLength(BOOL bAdjust, BOOL bTotal) +double CSoundFile::GetLength(BOOL bAdjust, BOOL bTotal) +//------------------------------------------- +{ + bool dummy = false; + return GetLength(dummy, bAdjust, bTotal); +} + +double CSoundFile::GetLength(bool& targetReached, BOOL bAdjust, BOOL bTotal, ORDERINDEX endOrder, ROWINDEX endRow) //---------------------------------------------------- { // -> CODE#0022 @@ -109,6 +116,12 @@ UINT nSpeedCount = 0; nRow = nNextRow; nCurrentPattern = nNextPattern; + if(nCurrentPattern == endOrder && nRow == endRow) + { + targetReached = true; + goto EndMod; + } + // Check if pattern is valid nPattern = Order[nCurrentPattern]; bool positionJumpOnThisRow=false; @@ -365,6 +378,10 @@ } } } + + return dwElapsedTime / 1000.0; + + /* // -> CODE#0022 // -> DESC="alternative BPM/Speed interpretation method" // return (UINT)((dwElapsedTime+500.0) / 1000.0); @@ -375,6 +392,7 @@ return (UINT)((dwElapsedTime + 500.0) / 1000.0); } // -! NEW_FEATURE#0022 + */ } @@ -442,6 +460,7 @@ } if (psmp->uFlags & CHN_PANNING) pChn->nPan = psmp->nPan; } + // Reset envelopes if (bResetEnv) { @@ -2611,6 +2630,7 @@ //rewbs.volOffset: moved offset code to own method as it will be used in several places now void CSoundFile::SampleOffset(UINT nChn, UINT param, bool bPorta) +//--------------------------------------------------------------- { MODCHANNEL *pChn = &Chn[nChn]; @@ -3340,3 +3360,4 @@ } + Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2007-04-13 22:43:39 UTC (rev 178) @@ -377,7 +377,12 @@ CTuningCollection CSoundFile::s_TuningsSharedLocal("Local Tunings"); -CSoundFile::CSoundFile() : m_TuningsTuneSpecific("Tune specific tunings"), PatternSize(*this), Patterns(*this), Order(*this), m_PlaybackEventer(*this) +CSoundFile::CSoundFile() : + m_TuningsTuneSpecific("Tune specific tunings"), + PatternSize(*this), Patterns(*this), + Order(*this), + m_PlaybackEventer(*this), + m_pModSpecs(&IT_SPECS) //---------------------- { m_nType = MOD_TYPE_NONE; @@ -690,6 +695,7 @@ if (m_nType) { + SetModSpecsPointer(); return TRUE; } @@ -1531,37 +1537,37 @@ CMainFrame::GetMainFrame()->MessageBox(str , "MoveChannel(...)", MB_OK | MB_ICONINFORMATION); return true; } - std::vector<UINT> newOrder; - //First creating new order identical to current order... - for(UINT i = 0; i<m_nChannels; i++) - { - newOrder.push_back(i); + std::vector<CHANNELINDEX> newOrder; + //First creating new order identical to current order... + for(UINT i = 0; i<m_nChannels; i++) + { + newOrder.push_back(i); + } + //...and then add the move channel effect. + if(chnFrom < chnTo) + { + CHANNELINDEX temp = newOrder[chnFrom]; + for(UINT i = chnFrom; i<chnTo; i++) + { + newOrder[i] = newOrder[i+1]; + } + newOrder[chnTo] = temp; + } + else //case chnFrom > chnTo(can't be equal, since it has been examined earlier.) + { + CHANNELINDEX temp = newOrder[chnFrom]; + for(UINT i = chnFrom; i>=chnTo+1; i--) + { + newOrder[i] = newOrder[i-1]; + } + newOrder[chnTo] = temp; } - //...and then add the move channel effect. - if(chnFrom < chnTo) - { - UINT temp = newOrder[chnFrom]; - for(UINT i = chnFrom; i<chnTo; i++) - { - newOrder[i] = newOrder[i+1]; - } - newOrder[chnTo] = temp; - } - else //case chnFrom > chnTo(can't be equal, since it has been examined earlier.) - { - UINT temp = newOrder[chnFrom]; - for(UINT i = chnFrom; i>=chnTo+1; i--) - { - newOrder[i] = newOrder[i-1]; - } - newOrder[chnTo] = temp; - } - if(newOrder.size() != ReArrangeChannels(newOrder)) - { - CMainFrame::GetMainFrame()->MessageBox("BUG: Channel number changed in MoveChannel()" , "", MB_OK | MB_ICONINFORMATION); - } - return false; + if(newOrder.size() != ReArrangeChannels(newOrder)) + { + CMainFrame::GetMainFrame()->MessageBox("BUG: Channel number changed in MoveChannel()" , "", MB_OK | MB_ICONINFORMATION); + } + return false; } @@ -2825,74 +2831,38 @@ return string(szNoteNames[abs(note-1)%12]) + Stringify((note-1)/12); } -WORD CSoundFile::GetTempoMin() const {return 32;} -WORD CSoundFile::GetTempoMax() const {return 512;} -ROWINDEX CSoundFile::GetRowMax() const -//------------------------------------ +void CSoundFile::SetModSpecsPointer() +//----------------------------------- { - switch(m_nType) + switch(GetModType()) { case MOD_TYPE_MPT: - return MPTM_SPECS.patternRowsMax; - case MOD_TYPE_MOD: - return MOD_SPECS.patternRowsMax; - case MOD_TYPE_XM: - return XM_SPECS.patternRowsMax; + m_pModSpecs = &MPTM_SPECS; + break; case MOD_TYPE_IT: - return IT_SPECS.patternRowsMax; - case MOD_TYPE_S3M: - return S3M_SPECS.patternRowsMax; - default: - return MAX_PATTERN_ROWS; - } -} - -ROWINDEX CSoundFile::GetRowMin() const -//------------------------------------ -{ - switch(m_nType) - { - case MOD_TYPE_MPT: - return MPTM_SPECS.patternRowsMin; - case MOD_TYPE_MOD: - return MOD_SPECS.patternRowsMin; + m_pModSpecs = &IT_SPECS; + break; case MOD_TYPE_XM: - return XM_SPECS.patternRowsMin; - case MOD_TYPE_IT: - return IT_SPECS.patternRowsMin; + m_pModSpecs = &XM_SPECS; + break; case MOD_TYPE_S3M: - return S3M_SPECS.patternRowsMin; + m_pModSpecs = &S3M_SPECS; + break; + case MOD_TYPE_MOD: default: - return 2; + m_pModSpecs = &MOD_SPECS; + break; } } - -CHANNELINDEX CSoundFile::GetNumChannelMax() const -//----------------------------------- -{ - if(m_nType == MOD_TYPE_MPT) return MPTM_SPECS.channelsMax; - if(m_nType == MOD_TYPE_IT) return max_chans_IT; - if(m_nType == MOD_TYPE_XM) return max_chans_XM; - if(m_nType == MOD_TYPE_MOD) return max_chans_MOD; - if(m_nType == MOD_TYPE_S3M) return max_chans_S3M; - return 4; -} - -CHANNELINDEX CSoundFile::GetNumChannelMin() const -//----------------------------------- -{ - if(m_nType == MOD_TYPE_MPT) return MPTM_SPECS.channelsMin; - else return 4; -} - void CSoundFile::ChangeModTypeTo(const int& newType) //--------------------------------------------------- { const UINT oldInvalidIndex = Patterns.GetInvalidIndex(); const UINT oldIgnoreIndex = Patterns.GetIgnoreIndex(); m_nType = newType; + SetModSpecsPointer(); m_ModFlags.reset(); @@ -2900,6 +2870,27 @@ replace(Order.begin(), Order.end(), oldIgnoreIndex, Patterns.GetIgnoreIndex()); } +bool CSoundFile::SetTitle(const char* titleCandidate, size_t strSize) +//------------------------------------------------------------------- +{ + if(strcmp(m_szNames[0], titleCandidate)) + { + memset(m_szNames[0], 0, sizeof(m_szNames[0])); + memcpy(m_szNames[0], titleCandidate, min(sizeof(m_szNames[0])-1, strSize)); + return true; + } + return false; +} + +double CSoundFile::GetPlaybackTimeAt(ORDERINDEX ord, ROWINDEX row) +//---------------------------------------------------------------- +{ + bool targetReached = false; + const double t = GetLength(targetReached, FALSE, TRUE, ord, row); + if(targetReached) return t; + else return -1; //Given position not found from play sequence. +} + #ifndef TRADITIONAL_MODCOMMAND void CSoundFile::OnSetEffect(MODCOMMAND& mc, EFFECT_ID eID) //--------------------------------------------------------- Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/soundlib/Sndfile.h 2007-04-13 22:43:39 UTC (rev 178) @@ -767,8 +767,6 @@ #include "../mptrack/patternContainer.h" #include "../mptrack/ordertopatterntable.h" -typedef CPatternContainer::PATTERNINDEX PATTERNINDEX; - #include "../mptrack/playbackEventer.h" @@ -789,31 +787,35 @@ const BYTE IT_STANDARD = 0; + //============== class CSoundFile //============== { public: //Typedefs - typedef CPatternContainer::PATTERNINDEX PATTERNINDEX; typedef UINT MODTYPE; public: //Get details(TODO?: Move detail asking to a 'controller') - WORD GetTempoMin() const; - WORD GetTempoMax() const; + TEMPO GetTempoMin() const {return m_pModSpecs->tempoMin;} + TEMPO GetTempoMax() const {return m_pModSpecs->tempoMax;} - ROWINDEX GetRowMax() const; - ROWINDEX GetRowMin() const; + //Using special hack for OMPTs modifed ITs and XMs. + ROWINDEX GetRowMax() const {return (GetType() == MOD_TYPE_IT || GetType() == MOD_TYPE_XM) ? 1024 : min(MAX_PATTERN_ROWS, m_pModSpecs->patternRowsMax);} - CHANNELINDEX GetNumChannelMax() const; - CHANNELINDEX GetNumChannelMin() const; + ROWINDEX GetRowMin() const {return m_pModSpecs->patternRowsMin;} + CHANNELINDEX GetNumChannelMax() const {return min(MAX_BASECHANNELS, m_pModSpecs->channelsMax);} + CHANNELINDEX GetNumChannelMin() const {return m_pModSpecs->channelsMin;} + uint16 GetModNameLengthMax() {return (GetModType() == MOD_TYPE_MPT) ? 25 : m_pModSpecs->modNameLengthMax;} - size_t GetModNameLengthMax() {return 25;} + //Return true if title was changed. + bool SetTitle(const char*, size_t strSize); public: //Misc void ChangeModTypeTo(const int& newType); - // - + MODTYPE GetModType() const {return m_nType;} - // + + //Return value in seconds. + double GetPlaybackTimeAt(ORDERINDEX, ROWINDEX); #ifndef TRADITIONAL_MODCOMMAND void OnSetEffect(MODCOMMAND& mc, EFFECT_ID); @@ -853,11 +855,15 @@ void PortamentoMPT(MODCHANNEL*, int); void PortamentoFineMPT(MODCHANNEL*, int); +private: //Misc private methods. + void SetModSpecsPointer(); + private: //'Controllers' CPlaybackEventer m_PlaybackEventer; private: //Misc data bitset<8> m_ModFlags; + const CModSpecifications* m_pModSpecs; @@ -910,7 +916,7 @@ MODCHANNELSETTINGS ChnSettings[MAX_BASECHANNELS]; // Channels settings CPatternContainer Patterns; //Patterns CPatternSizesMimic PatternSize; // Mimics old PatternsSize-array(is read-only). - COrderToPatternTable Order; //Order[x] gives the pattern index at order x. + COrderToPatternTable Order; // Order[x] gives the index of the pattern located at order x. MODINSTRUMENT Ins[MAX_SAMPLES]; // Instruments INSTRUMENTHEADER *Headers[MAX_INSTRUMENTS]; // Instrument Headers INSTRUMENTHEADER m_defaultInstrument; // Currently only used to get default values for extented properties. @@ -974,8 +980,18 @@ CString GetPatternViewInstrumentName(UINT nInstr, bool returnEmptyInsteadOfNoName = false) const; UINT GetMusicSpeed() const { return m_nMusicSpeed; } UINT GetMusicTempo() const { return m_nMusicTempo; } - DWORD GetLength(BOOL bAdjust, BOOL bTotal=FALSE); - DWORD GetSongTime() { return GetLength(FALSE, TRUE); } + + //Get modlength in various cases: total length, length to + //specific order&row etc. Return value is in seconds. + //NOTE: Also seems to be used for some 'simulate playback'-purposes (Relabs, April 2007) + double GetLength(BOOL bAdjust, BOOL bTotal=FALSE); +private: + double GetLength(bool& targetReached, BOOL bAdjust, BOOL bTotal=FALSE, ORDERINDEX ord = ORDERINDEX_MAX, ROWINDEX row = ROWINDEX_MAX); + +public: + //Returns song length in seconds. + DWORD GetSongTime() { return static_cast<DWORD>((m_nTempoMode == tempo_mode_alternative) ? GetLength(FALSE, TRUE)+1.0 : GetLength(FALSE, TRUE)+0.5); } + void SetRepeatCount(int n) { m_nRepeatCount = n; } int GetRepeatCount() const { return m_nRepeatCount; } BOOL IsPaused() const { return (m_dwSongFlags & SONG_PAUSED) ? TRUE : FALSE; } @@ -992,7 +1008,6 @@ //channel settings. Flag can be used to tell whether to completely //reset channels, not only a few settings(for maintaining old behavior). void ResetChannelSettings(CHANNELINDEX chn, BYTE resetStyle); - //For all channels. void ResetChannelSettings(BYTE resetStyle); Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2007-04-01 00:28:16 UTC (rev 177) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2007-04-13 22:43:39 UTC (rev 178) @@ -7,20 +7,20 @@ { //NOTE: If changing order, update all initializations below. char fileExtension[10]; - UINT patternsMax; - UINT ordersMax; - UINT channelsMin; - UINT channelsMax; + PATTERNINDEX patternsMax; + ORDERINDEX ordersMax; + CHANNELINDEX channelsMin; + CHANNELINDEX channelsMax; //NOTE: The two above refer to the user editable pattern channels, //not to the internal sound channels. Maybe there should be a separate //setting for those(comment by: Relabs, January 2007). - UINT tempoMin; - UINT tempoMax; - UINT patternRowsMin; - UINT patternRowsMax; - UINT modNameLengthMax; //Meaning 'usable letters', possible null character is not included. - UINT samplesMax; - UINT instrumentsMax; + TEMPO tempoMin; + TEMPO tempoMax; + ROWINDEX patternRowsMin; + ROWINDEX patternRowsMax; + uint16 modNameLengthMax; //Meaning 'usable letters', possible null character is not included. + SAMPLEINDEX samplesMax; + INSTRUMENTINDEX instrumentsMax; }; enum { @@ -48,7 +48,7 @@ 256, //Channel max 32, //Min tempo 512, //Max tempo - 2, //Min pattern rows + 1, //Min pattern rows 1024, //Max pattern rows 256, //Max mod name length 4000, //SamplesMax @@ -70,7 +70,7 @@ 256, //Max tempo 64, //Min pattern rows 64, //Max pattern rows - 25, //Max mod name length + 20, //Max mod name length 31, //SamplesMax 0, //instrumentMax }; @@ -87,10 +87,10 @@ 32, //Min tempo 256, //Max tempo 4, //Min pattern rows - 256, //Max pattern rows - 25, //Max mod name length + 256, //Max pattern rows + 20, //Max mod name length 31, //SamplesMax - 256, //instrumentMax + 256, //instrumentMax }; @@ -106,7 +106,7 @@ 256, //Max tempo 64, //Min pattern rows 64, //Max pattern rows - 25, //Max mod name length + 27, //Max mod name length 31, //SamplesMax 0, //instrumentMax }; @@ -125,7 +125,7 @@ 256, //Max pattern rows 25, //Max mod name length(in ittech.txt: "0000: \xB3'I'\xB3'M'\xB3'P'\xB3'M'\xB3 Song Name, max 26 characters, includes NULL \xB3") 256, //SamplesMax - 256, //instrumentMax + 256, //instrumentMax }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <re...@us...> - 2007-05-07 11:44:18
|
Revision: 180 http://svn.sourceforge.net/modplug/?rev=180&view=rev Author: rewbs Date: 2007-05-07 04:41:47 -0700 (Mon, 07 May 2007) Log Message: ----------- + <rewbs> Check for updates on startup. / <rewbs> Delete CPU specific binaries. / <rewbs> Update package template / <rewbs> Misc internal renames Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp trunk/OpenMPT/mptrack/SoundFilePlayConfig.h trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/Vstplug.h trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Added Paths: ----------- trunk/OpenMPT/mptrack/bin/mptrack.exe trunk/OpenMPT/packageTemplate/Installation.txt trunk/OpenMPT/packageTemplate/tunings/ trunk/OpenMPT/packageTemplate/tunings/standard/ trunk/OpenMPT/packageTemplate/tunings/standard/std_tunings.tc Removed Paths: ------------- trunk/OpenMPT/mptrack/bin/mptrack_Generic.exe trunk/OpenMPT/mptrack/bin/mptrack_P3.exe trunk/OpenMPT/mptrack/bin/mptrack_P4-Athlon64.exe trunk/OpenMPT/mptrack/bin/mptrack_athlon32.exe trunk/OpenMPT/mptrack/bin/testSvnCommitList3 Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2007-05-07 11:41:47 UTC (rev 180) @@ -86,6 +86,7 @@ ON_COMMAND(ID_MIDI_RECORD, OnMidiRecord) ON_COMMAND(ID_PLAYER_PAUSE, OnPlayerPause) ON_COMMAND_EX(IDD_TREEVIEW, OnBarCheck) + ON_COMMAND_EX(ID_NETLINK_OPENMPTWIKI, OnInternetLink) ON_COMMAND_EX(ID_NETLINK_MODPLUG, OnInternetLink) ON_COMMAND_EX(ID_NETLINK_UT, OnInternetLink) ON_COMMAND_EX(ID_NETLINK_OSMUSIC, OnInternetLink) @@ -140,6 +141,8 @@ LONG CMainFrame::glTreeSplitRatio = 128; HHOOK CMainFrame::ghKbdHook = NULL; CString CMainFrame::gcsPreviousVersion = ""; +CString CMainFrame::gcsInstallGUID = ""; +int CMainFrame::gnCheckForUpdates = 1; DWORD CMainFrame::gnHotKeyMask = 0; // Audio Setup //rewbs.resamplerConf @@ -361,7 +364,9 @@ CString iniFile = theApp.GetConfigFileName(); CHAR collectedString[INIBUFFERSIZE]; - gcsPreviousVersion = GetPrivateProfileCString("Version", "Version", "", theApp.GetConfigFileName()); + gcsPreviousVersion = GetPrivateProfileCString("Version", "Version", "", iniFile); + gcsInstallGUID = GetPrivateProfileCString("Version", "InstallGUID", "", iniFile); + gnCheckForUpdates = GetPrivateProfileInt("Version", "CheckForUpdates", 1, iniFile); gbMdiMaximize = GetPrivateProfileLong("Display", "MDIMaximize", true, iniFile); glTreeWindowWidth = GetPrivateProfileLong("Display", "MDITreeWidth", 160, iniFile); glTreeSplitRatio = GetPrivateProfileLong("Display", "MDITreeRatio", 128, iniFile); @@ -375,7 +380,7 @@ gnPlugWindowY = GetPrivateProfileInt("Display", "PlugSelectWindowY", 273, iniFile); gnPlugWindowWidth = GetPrivateProfileInt("Display", "PlugSelectWindowWidth", 370, iniFile); gnPlugWindowHeight = GetPrivateProfileInt("Display", "PlugSelectWindowHeight", 332, iniFile); - gnPlugWindowLast = GetPrivateProfileInt("Display", "PlugSelectWindowLast", 0, iniFile); + gnPlugWindowLast = GetPrivateProfileDWord("Display", "PlugSelectWindowLast", 0, iniFile); CHAR s[16]; for (int ncol=0; ncol<MAX_MODCOLORS; ncol++) { @@ -848,6 +853,8 @@ CString version = CMainFrame::GetFullVersionString(); WritePrivateProfileString("Version", "Version", version, iniFile); + WritePrivateProfileString("Version", "InstallGUID", gcsInstallGUID, iniFile); + WritePrivateProfileLong("Version", "CheckForUpdates", gnCheckForUpdates, iniFile); WINDOWPLACEMENT wpl; wpl.length = sizeof(WINDOWPLACEMENT); @@ -2686,6 +2693,7 @@ switch(nID) { // case ID_NETLINK_MODPLUG: pszURL = "http://www.modplug.com"; break; + case ID_NETLINK_OPENMPTWIKI:pszURL = "http://openmpt.xwiki.com/"; break; case ID_NETLINK_UT: pszURL = "http://www.united-trackers.org"; break; case ID_NETLINK_OSMUSIC: pszURL = "http://www.osmusic.net/"; break; // case ID_NETLINK_HANDBOOK: pszURL = "http://www.modplug.com/mods/handbook/handbook.htm"; break; Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2007-05-07 11:41:47 UTC (rev 180) @@ -366,6 +366,8 @@ static HHOOK ghKbdHook; static DWORD gdwNotificationType; static CString gcsPreviousVersion; + static CString gcsInstallGUID; + static int gnCheckForUpdates; // Audio Setup static DWORD m_dwSoundSetup, m_dwRate, m_dwQuality, m_nSrcMode, m_nBitsPerSample, m_nPreAmp, gbLoopSong, m_nChannels; Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2007-05-07 11:41:47 UTC (rev 180) @@ -552,6 +552,7 @@ m_hBladeEnc = NULL; m_hLameEnc = NULL; m_hACMInst = NULL; + m_pRequestContext = NULL; m_hAlternateResourceHandle = NULL; m_szConfigFileName[0] = 0; for (UINT i=0; i<MAX_DLS_BANKS; i++) gpDLSBanks[i] = NULL; @@ -785,7 +786,11 @@ m_dwTimeStarted = timeGetTime(); m_bInitialized = TRUE; - // Check previous version number + if (CMainFrame::gnCheckForUpdates) { + UpdateCheck(); + } + + // Open settings if this is the previous execution was with an earlier version. if (!cmdInfo.m_bNoSettingsOnNewVersion && CMainFrame::gcsPreviousVersion < CMainFrame::GetFullVersionString()) { StopSplashScreen(); m_pMainWnd->PostMessage(WM_COMMAND, ID_VIEW_OPTIONS); @@ -795,6 +800,185 @@ return TRUE; } +void __stdcall CTrackApp::InternetRequestCallback( HINTERNET hInternet, DWORD_PTR userData, DWORD dwInternetStatus, + LPVOID lpvStatusInformation, DWORD dwStatusInformationLength) +//----------------------------------------------------------------------------------------------------- +{ + + REQUEST_CONTEXT *pRequestContext = (REQUEST_CONTEXT*)userData; + if (pRequestContext->hRequest == NULL) { + return; + } + + DWORD versionBytesToRead = 10; + + switch (dwInternetStatus) { + case WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE: + if (!WinHttpReceiveResponse(pRequestContext->hRequest, NULL)) { + CleanupInternetRequest(pRequestContext); + return; + } + break; + case WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE: + { + DWORD dwDownloaded = 0; + if (!WinHttpQueryDataAvailable(pRequestContext->hRequest, &dwDownloaded)) { + Log("Error %u in WinHttpQueryDataAvailable.\n",GetLastError()); + CleanupInternetRequest(pRequestContext); + return; + } + if (dwDownloaded<versionBytesToRead) { + Log("Downloaded %d bytes, expected at least %d\n", dwDownloaded, versionBytesToRead); + CleanupInternetRequest(pRequestContext); + return; + } + break; + } + case WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE: + { + DWORD dwRead = 0; + pRequestContext->lpBuffer = new char[versionBytesToRead+1]; + ZeroMemory(pRequestContext->lpBuffer, versionBytesToRead+1); + + if (!WinHttpReadData(pRequestContext->hRequest, (LPVOID)pRequestContext->lpBuffer, versionBytesToRead, &dwRead)) { + Log("Error %u in WinHttpReadData.\n", GetLastError()); + CleanupInternetRequest(pRequestContext); + return; + } + if (dwRead<versionBytesToRead) { + Log("Read %d bytes, expected at least %d\n", dwRead, versionBytesToRead); + CleanupInternetRequest(pRequestContext); + return; + } + break; + } + case WINHTTP_CALLBACK_STATUS_READ_COMPLETE: + { + CString remoteVersion = pRequestContext->lpBuffer; + CString localVersion = CMainFrame::GetFullVersionString(); + if (remoteVersion > localVersion) { + CString message; + message.Format("New version available: %s. Would you like more information?", remoteVersion); + if (AfxMessageBox(message, MB_ICONQUESTION|MB_YESNO ) == IDYES) { + CString URL; + URL.Format("http://openmpt.xwiki.com/xwiki/bin/view/Development/Builds?currentVersion=%s", localVersion); + CTrackApp::OpenURL(URL); + } + } + CleanupInternetRequest(pRequestContext); + break; + } + default: + Log("Unhandled callback - status %d given", dwInternetStatus); + break; + } + +} + +void CTrackApp::CleanupInternetRequest(REQUEST_CONTEXT *pRequestContext) +//------------------------------------------------------------------------- +{ + if (pRequestContext != NULL) { + if (pRequestContext->lpBuffer != NULL) { + delete[] pRequestContext->lpBuffer; + pRequestContext->lpBuffer = NULL; + } + + if (pRequestContext->postData != NULL) { + delete[] pRequestContext->postData; + pRequestContext->postData = NULL; + } + + if (pRequestContext->hRequest != NULL) { + WinHttpSetStatusCallback(pRequestContext->hRequest, NULL, NULL, NULL); + WinHttpCloseHandle(pRequestContext->hRequest); + pRequestContext->hRequest = NULL; + } + + if (pRequestContext->hConnection != NULL) { + WinHttpCloseHandle(pRequestContext->hConnection); + pRequestContext->hConnection = NULL; + } + + if (pRequestContext->hSession != NULL) { + WinHttpCloseHandle(pRequestContext->hSession); + pRequestContext->hSession = NULL; + } + } +} + +void CTrackApp::UpdateCheck() +//--------------------------- +{ + m_pRequestContext = new REQUEST_CONTEXT(); + m_pRequestContext->hSession = NULL; + m_pRequestContext->hConnection = NULL; + m_pRequestContext->hRequest = NULL; + m_pRequestContext->lpBuffer = NULL; + m_pRequestContext->postData = NULL; + + // Prepare post data + if (CMainFrame::gcsInstallGUID == "") { + //No GUID found in INI file - generate one. + GUID guid; + CoCreateGuid(&guid); + BYTE* Str; + UuidToString((UUID*)&guid, &Str); + CMainFrame::gcsInstallGUID.Format("%s", (LPTSTR)Str); + RpcStringFree(&Str); + } + + CString csPostData; + csPostData.Format("install_id=%s&install_version=%s", CMainFrame::gcsInstallGUID, CMainFrame::GetFullVersionString()); + int length = csPostData.GetLength(); + m_pRequestContext->postData = new char[length+1]; + strcpy(m_pRequestContext->postData, csPostData); + + m_pRequestContext->hSession = WinHttpOpen( L"OpenMPT/1.17", WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, + WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, WINHTTP_FLAG_ASYNC); + if (m_pRequestContext->hSession==NULL) { + CleanupInternetRequest(m_pRequestContext); + return; + } + + m_pRequestContext->hConnection = WinHttpConnect(m_pRequestContext->hSession, L"www.soal.org", INTERNET_DEFAULT_HTTP_PORT, 0); + if (m_pRequestContext->hConnection==NULL) { + CleanupInternetRequest(m_pRequestContext); + return; + } + + m_pRequestContext->hRequest = WinHttpOpenRequest(m_pRequestContext->hConnection, L"POST", L"openmpt/OpenMPTversionCheck.php5", + NULL, NULL, NULL, 0); + if (m_pRequestContext->hRequest==NULL) { + CleanupInternetRequest(m_pRequestContext); + return; + } + + if (!WinHttpAddRequestHeaders(m_pRequestContext->hRequest, L"Content-Type:application/x-www-form-urlencoded\r\n\r\n", + -1L, WINHTTP_ADDREQ_FLAG_ADD)) { + CleanupInternetRequest(m_pRequestContext); + return; + } + + WINHTTP_STATUS_CALLBACK pCallback = WinHttpSetStatusCallback(m_pRequestContext->hRequest, + static_cast<WINHTTP_STATUS_CALLBACK>(InternetRequestCallback), + WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS, + NULL); + if (pCallback == WINHTTP_INVALID_STATUS_CALLBACK) { + Log("Error %d in WinHttpSetStatusCallback.\n", WINHTTP_INVALID_STATUS_CALLBACK); + CleanupInternetRequest(m_pRequestContext); + return; + } + + if (!WinHttpSendRequest(m_pRequestContext->hRequest, WINHTTP_NO_ADDITIONAL_HEADERS, 0, m_pRequestContext->postData, length, length, (DWORD_PTR)m_pRequestContext)) { + CleanupInternetRequest(m_pRequestContext); + return; + } +} + + + + int CTrackApp::ExitInstance() //--------------------------- { @@ -846,6 +1030,10 @@ // Uninitialize ACM UninitializeACM(); + // Cleanup the internet request, in case it is still active. + CleanupInternetRequest(m_pRequestContext); + delete m_pRequestContext; + return CWinApp::ExitInstance(); } Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/Mptrack.h 2007-05-07 11:41:47 UTC (rev 180) @@ -14,6 +14,8 @@ #include "resource.h" // main symbols #include "sndfile.h" +#include <windows.h> +#include <winhttp.h> class CModDoc; class CVstPluginManager; @@ -94,6 +96,17 @@ ///////////////////////////////////////////////////////////////////////////// +// Internet connection context + +typedef struct REQUEST_CONTEXT { + HINTERNET hSession; + HINTERNET hConnection; + HINTERNET hRequest; + LPSTR lpBuffer; // Buffer for storing read data + LPSTR postData; +} REQUEST_CONTEXT; + +///////////////////////////////////////////////////////////////////////////// // CTrackApp: // See mptrack.cpp for the implementation of this class // @@ -107,10 +120,7 @@ protected: static UINT m_nDefaultDocType; static LPMIDILIBSTRUCT glpMidiLibrary; -// -> CODE#0023 -// -> DESC="IT project files (.itp)" static BOOL m_nProject; -// -! NEW_FEATURE#0023 public: static MEMORYSTATUS gMemStatus; @@ -127,6 +137,8 @@ CHAR m_szConfigFileName[_MAX_PATH]; CHAR m_szPluginCacheFileName[_MAX_PATH]; CHAR m_szStringsFileName[_MAX_PATH]; + // Internet request context + REQUEST_CONTEXT *m_pRequestContext; public: CTrackApp(); @@ -168,6 +180,10 @@ protected: VOID StartSplashScreen(); VOID StopSplashScreen(); + VOID UpdateCheck(); + static void __stdcall InternetRequestCallback( HINTERNET hInternet, DWORD_PTR dwContext, DWORD dwInternetStatus, + LPVOID lpvStatusInformation, DWORD dwStatusInformationLength); + static void CleanupInternetRequest(REQUEST_CONTEXT *pRequestContext); // Localized strings public: Modified: trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp =================================================================== --- trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp 2007-05-07 11:41:47 UTC (rev 180) @@ -3,7 +3,7 @@ CSoundFilePlayConfig::CSoundFilePlayConfig(void) { - SetPluginMixLevels(plugmix_mode_117RC3); + SetPluginMixLevels(mixLevels_117RC3); setVSTiVolume(1.0f); } @@ -15,13 +15,13 @@ switch (mixLevelType) { // Olivier's version gives us floats in [-0.5; 0.5] and slightly saturates VSTis. - case plugmix_mode_original: + case mixLevels_original: setVSTiAttenuation(NO_ATTENUATION); setIntToFloat(1.0f/static_cast<float>(1<<28)); setFloatToInt(static_cast<float>(1<<28)); setGlobalVolumeAppliesToMaster(false); setUseGlobalPreAmp(true); - setTreatPanLikeBalance(false); + setForceSoftPanning(false); setDisplayDBValues(false); setNormalSamplePreAmp(128.0); setNormalVSTiVol(100.0); @@ -30,13 +30,13 @@ // Ericus' version gives us floats in [-0.06;0.06] and requires attenuation to // avoid massive VSTi saturation. - case plugmix_mode_117RC1: + case mixLevels_117RC1: setVSTiAttenuation(32.0f); setIntToFloat(1.0f/static_cast<float>(0x07FFFFFFF)); setFloatToInt(static_cast<float>(0x07FFFFFFF)); setGlobalVolumeAppliesToMaster(false); setUseGlobalPreAmp(true); - setTreatPanLikeBalance(false); + setForceSoftPanning(false); setDisplayDBValues(false); setNormalSamplePreAmp(128.0); setNormalVSTiVol(100.0); @@ -46,13 +46,13 @@ // 117RC2 gives us floats in [-1.0; 1.0] and hopefully plays VSTis at // the right volume... but we attenuate by 2x to approx. match sample volume. - case plugmix_mode_117RC2: + case mixLevels_117RC2: setVSTiAttenuation(2.0f); setIntToFloat(1.0f/static_cast<float>(MIXING_CLIPMAX)); setFloatToInt(static_cast<float>(MIXING_CLIPMAX)); setGlobalVolumeAppliesToMaster(true); setUseGlobalPreAmp(true); - setTreatPanLikeBalance(false); + setForceSoftPanning(false); setDisplayDBValues(false); setNormalSamplePreAmp(128.0); setNormalVSTiVol(100.0); @@ -63,13 +63,13 @@ // treats panning as balance to avoid saturation on loud sample (and because I think it's better :), // and allows display of attenuation in decibels. default: - case plugmix_mode_117RC3: + case mixLevels_117RC3: setVSTiAttenuation(1.0f); setIntToFloat(1.0f/static_cast<float>(MIXING_CLIPMAX)); setFloatToInt(static_cast<float>(MIXING_CLIPMAX)); setGlobalVolumeAppliesToMaster(true); setUseGlobalPreAmp(false); - setTreatPanLikeBalance(true); + setForceSoftPanning(true); setDisplayDBValues(true); setNormalSamplePreAmp(128.0); setNormalVSTiVol(128.0); @@ -78,13 +78,13 @@ // FOR TEST PURPOSES ONLY: /* - case plugmix_mode_Test: + case mixLevels_Test: setVSTiAttenuation(1.0f); setIntToFloat(1.0f/static_cast<float>(MIXING_CLIPMAX)); setFloatToInt(static_cast<float>(MIXING_CLIPMAX)); setGlobalVolumeAppliesToMaster(true); setUseGlobalPreAmp(false); - setTreatPanLikeBalance(true); + setForceSoftPanning(true); setDisplayDBValues(true); setNormalSamplePreAmp(128.0); setNormalVSTiVol(128.0); @@ -158,12 +158,12 @@ } -bool CSoundFilePlayConfig::getTreatPanLikeBalance() { - return m_treatPanLikeBalance; +bool CSoundFilePlayConfig::getForceSoftPanning() { + return m_forceSoftPanning; } -void CSoundFilePlayConfig::setTreatPanLikeBalance(bool inTreatPanLikeBalance) { - m_treatPanLikeBalance=inTreatPanLikeBalance; +void CSoundFilePlayConfig::setForceSoftPanning(bool inForceSoftPanning) { + m_forceSoftPanning=inForceSoftPanning; } void CSoundFilePlayConfig::setDisplayDBValues(bool in) { Modified: trunk/OpenMPT/mptrack/SoundFilePlayConfig.h =================================================================== --- trunk/OpenMPT/mptrack/SoundFilePlayConfig.h 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/SoundFilePlayConfig.h 2007-05-07 11:41:47 UTC (rev 180) @@ -13,11 +13,11 @@ }; enum { - plugmix_mode_original = 0, - plugmix_mode_117RC1 = 1, - plugmix_mode_117RC2 = 2, - plugmix_mode_117RC3 = 3, - plugmix_mode_Test = 4, + mixLevels_original = 0, + mixLevels_117RC1 = 1, + mixLevels_117RC2 = 2, + mixLevels_117RC3 = 3, + mixLevels_Test = 4, }; // Class used to store settings for a song file. @@ -49,8 +49,8 @@ void setUseGlobalPreAmp(bool); bool getUseGlobalPreAmp(); - void setTreatPanLikeBalance(bool); - bool getTreatPanLikeBalance(); + void setForceSoftPanning(bool); + bool getForceSoftPanning(); void setDisplayDBValues(bool); bool getDisplayDBValues(); @@ -80,7 +80,7 @@ bool m_globalVolumeAppliesToMaster; bool m_ignorePreAmp; - bool m_treatPanLikeBalance; + bool m_forceSoftPanning; bool m_displayDBValues; DWORD m_LastSavedWithVersion; Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2007-05-07 11:41:47 UTC (rev 180) @@ -1185,7 +1185,20 @@ } } +VOID CSelectPluginDlg::OnCancel() +//--------------------------- +{ + //remember window size: + RECT rect; + GetWindowRect(&rect); + CMainFrame::GetMainFrame()->gnPlugWindowX = rect.left; + CMainFrame::GetMainFrame()->gnPlugWindowY = rect.top; + CMainFrame::GetMainFrame()->gnPlugWindowWidth = rect.right - rect.left; + CMainFrame::GetMainFrame()->gnPlugWindowHeight = rect.bottom - rect.top; + CDialog::OnCancel(); +} + VOID CSelectPluginDlg::UpdatePluginsList(DWORD forceSelect/*=0*/) //--------------------------------------------------------------- { Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/Vstplug.h 2007-05-07 11:41:47 UTC (rev 180) @@ -241,6 +241,7 @@ virtual void DoDataExchange(CDataExchange* pDX); virtual BOOL OnInitDialog(); virtual VOID OnOK(); + virtual VOID OnCancel(); afx_msg void OnAddPlugin(); afx_msg void OnRemovePlugin(); afx_msg void OnSelChanged(NMHDR *pNotifyStruct, LRESULT * result); Added: trunk/OpenMPT/mptrack/bin/mptrack.exe =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/mptrack/bin/mptrack.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/OpenMPT/mptrack/bin/mptrack_Generic.exe =================================================================== (Binary files differ) Deleted: trunk/OpenMPT/mptrack/bin/mptrack_P3.exe =================================================================== (Binary files differ) Deleted: trunk/OpenMPT/mptrack/bin/mptrack_P4-Athlon64.exe =================================================================== (Binary files differ) Deleted: trunk/OpenMPT/mptrack/bin/mptrack_athlon32.exe =================================================================== (Binary files differ) Deleted: trunk/OpenMPT/mptrack/bin/testSvnCommitList3 =================================================================== Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2007-05-07 11:41:47 UTC (rev 180) @@ -185,18 +185,18 @@ default: m_TempoModeBox.SetCurSel(0); break; } - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC3"), plugmix_mode_117RC3); - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC2"), plugmix_mode_117RC2); - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), plugmix_mode_117RC1); - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Original"), plugmix_mode_original); - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Test"), plugmix_mode_Test); - switch(m_pSndFile->m_nPlugMixMode) + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC3"), mixLevels_117RC3); + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC2"), mixLevels_117RC2); + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), mixLevels_117RC1); + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Original"), mixLevels_original); + //m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Test"), mixLevels_Test); + switch(m_pSndFile->m_nMixLevels) { - //case plugmix_mode_Test: m_PlugMixBox.SetCurSel(3); break; - case plugmix_mode_original: m_PlugMixBox.SetCurSel(3); break; - case plugmix_mode_117RC1: m_PlugMixBox.SetCurSel(2); break; - case plugmix_mode_117RC2: m_PlugMixBox.SetCurSel(1); break; - case plugmix_mode_117RC3: + //case mixLevels_Test: m_PlugMixBox.SetCurSel(4); break; + case mixLevels_original: m_PlugMixBox.SetCurSel(3); break; + case mixLevels_117RC1: m_PlugMixBox.SetCurSel(2); break; + case mixLevels_117RC2: m_PlugMixBox.SetCurSel(1); break; + case mixLevels_117RC3: default: m_PlugMixBox.SetCurSel(0); break; } @@ -383,8 +383,8 @@ sel = m_PlugMixBox.GetCurSel(); if (sel >= 0) { - m_pSndFile->m_nPlugMixMode = m_PlugMixBox.GetItemData(sel); - m_pSndFile->m_pConfig->SetPluginMixLevels(m_pSndFile->m_nPlugMixMode); + m_pSndFile->m_nMixLevels = m_PlugMixBox.GetItemData(sel); + m_pSndFile->m_pConfig->SetPluginMixLevels(m_pSndFile->m_nMixLevels); m_pSndFile->RecalculateGainForAllPlugs(); } Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/mptrack.rc 2007-05-07 11:41:47 UTC (rev 180) @@ -189,6 +189,7 @@ MENUITEM SEPARATOR POPUP "&Internet" BEGIN + MENUITEM "OpenMPT Wiki", ID_NETLINK_OPENMPTWIKI MENUITEM "Modplug Central &Forums", ID_NETLINK_FORUMS MENUITEM "MPT-FR", ID_NETLINK_MPTFR MENUITEM "&Kvr Audio (plugins)", ID_NETLINK_PLUGINS @@ -943,7 +944,7 @@ COMBOBOX IDC_COMBO4,156,135,81,51,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP GROUPBOX "Playback",IDC_STATIC,4,99,240,62 - LTEXT "Plugin levels:",IDC_STATIC,111,138,43,10 + LTEXT "Mix Levels:",IDC_STATIC,111,138,43,10 GROUPBOX "OpenMPT Version Info",IDC_STATIC,4,165,235,44 EDITTEXT IDC_EDIT1,67,175,166,13,ES_AUTOHSCROLL | ES_READONLY, WS_EX_STATICEDGE @@ -1399,7 +1400,7 @@ CAPTION "Sound Card" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - GROUPBOX "",IDC_STATIC,4,3,232,150 + GROUPBOX "",IDC_STATIC,4,3,232,167 LTEXT "Sound Device:",IDC_STATIC,9,12,79,8 CONTROL "",IDC_COMBO1,"ComboBoxEx32",CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP,10,23,219,96 @@ -1429,8 +1430,10 @@ WS_TABSTOP CONTROL "Reverse Stereo",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,131,78,62,10 - CONTROL "Headphones",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | + CONTROL "Soft Panning",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,131,90,64,10 + LTEXT "Note: The Pre-Amp and Soft Panning settings are ignored by songs with mix levels set to 1.17RC3 or later in Song Properties.", + IDC_STATIC,16,150,204,18 END IDD_MIDIMACRO DIALOGEX 0, 0, 349, 345 @@ -2076,7 +2079,7 @@ IDD_OPTIONS_SOUNDCARD, DIALOG BEGIN RIGHTMARGIN, 240 - BOTTOMMARGIN, 156 + BOTTOMMARGIN, 177 END IDD_MIDIMACRO, DIALOG Modified: trunk/OpenMPT/mptrack/mptrack.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack.vcproj 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/mptrack.vcproj 2007-05-07 11:41:47 UTC (rev 180) @@ -45,13 +45,14 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib" + AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib winhttp.lib" OutputFile=".\Debug/mptrack.exe" Version="5.0" LinkIncremental="2" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="..\xsoundlib\Debug" GenerateDebugInformation="TRUE" + AssemblyDebug="1" ProgramDatabaseFile=".\Debug/mptrack.pdb" GenerateMapFile="TRUE" MapFileName=".\Debug/mptrack.map" @@ -116,8 +117,8 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib" - OutputFile=".\Bin/mptrack_Generic.exe" + AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib winhttp.lib" + OutputFile=".\Bin/mptrack.exe" Version="5.0" LinkIncremental="1" SuppressStartupBanner="TRUE" @@ -188,7 +189,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib" + AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib winhttp.lib" OutputFile=".\Bin/mptrack_P3.exe" Version="5.0" LinkIncremental="1" @@ -260,7 +261,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib" + AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib winhttp.lib" OutputFile=".\Bin/mptrack_athlon32.exe" Version="5.0" LinkIncremental="1" @@ -332,7 +333,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib" + AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib xsoundlib.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib winhttp.lib" OutputFile=".\Bin/mptrack_P4-Athlon64.exe" Version="5.0" LinkIncremental="1" Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/mptrack/resource.h 2007-05-07 11:41:47 UTC (rev 180) @@ -544,7 +544,7 @@ #define IDC_EDIT_SPEED 2008 #define IDC_EDIT_GLOBALVOL 2009 #define IDC_EDIT_RESTARTPOS 2010 -#define IDC_SLIDER_SAMPLEPREAMP 2011 +#define IDC_SLIDER_SAMPLEPREAMP 2011 #define IDC_BUTTON_MODTYPE 2012 #define IDC_EDIT_SAMPLEPA 2013 #define IDC_EDIT_MODTYPE 2014 @@ -969,7 +969,7 @@ #define ID_MOVETUNING 36025 #define ID_COPYTUNING 36026 #define ID_REMOVETUNINGCOLLECTION 36027 -#define ID_SHOWTIMEATROW 36028 +#define ID_SHOWTIMEATROW 36028 #define ID_SELECTINST 36100 #define ID_NETLINK_MPTFR 37001 #define ID_PLUG_RECORDAUTOMATION 37003 @@ -1006,6 +1006,7 @@ #define ID_ENVELOPE_TOGGLERELEASENODE 59206 #define ID_Menu59207 59207 #define ID_ENVELOPE_SCALEPOINTS 59208 +#define ID_NETLINK_OPENMPTWIKI 59210 // Next default values for new objects // @@ -1013,7 +1014,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 515 -#define _APS_NEXT_COMMAND_VALUE 59209 +#define _APS_NEXT_COMMAND_VALUE 59211 #define _APS_NEXT_CONTROL_VALUE 2304 #define _APS_NEXT_SYMED_VALUE 901 #endif Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/packageTemplate/History.txt 2007-05-07 11:41:47 UTC (rev 180) @@ -8,6 +8,57 @@ ?: other (tx XYZ): thanks to XYZ for telling me about the bug +v1.17.02.46 + + <Relabsoluness> Experimental MPTm format: + --> Internally, it is still very close to the IT-based format. + --> Order&pattern limit increased to 65000; whole range not tested :) (Note that modeffects such as position jump doesn't cover the whole range unless the #-extension can be used(haven't tested)) + + <Relabsoluness> User definable tuning modes for instruments: + --> Only available for MPTm + --> Ratio value as well as note name for every key can be assigned invidually; gives rather free hands for experiments. + --> Every instrument can have it's own tuning + --> Tunings can be saved to file and loaded from file. + --> IMPORTANT: When using tunings, behavior of various modcommands such as portamento have been changed, and new behaviors are still to be decided. + + <Relabsoluness> In song properties, option to increase playback compatibility with original Impulse Tracker behavior. Is in no way complete; currently affects only a couple of differences. Many differences are still there. + + <Relabsoluness> Ability to load multiple mods/samples/instruments from corresponding load dialogs. + --> Known issue: Intermittent failures. + + <Relabsoluness> 32-bit float wav import + . <Relabsoluness> 24/32-bit PCM wav sample import fixed + + <Relabsoluness> Playback control additions: 'Solo on transition' & 'Mute on transition'. Available from pattern view context menu(right click). + + <Relabsoluness> Envelope points can be scaled by a factor through context menu on envelopeview(right click) + + <Relabsoluness> Calculator of playback time (measured from start) at the beginning of any row of any pattern (uses existing modlength calculator). + --> Known limitation: When the row is within pattern loop, doesn't give all possible times. + + <rewbs> SCx now sends note-off to VSTis at tick x. + + <rewbs> New mixmode (called 1.17RC3): bypass global preamp, force soft panning, provide explicit dB value for sample attenuation. WARNING: this mixmode is subject to change. + + <rewbs> Check for updates on startup. To disable, set CheckForUpdates=0 in mptrack.ini. + . <rewbs> Plugin list window remembers its position/size even on cancel. + . <Relabsoluness> When opening instruments, load dialog didn't remember its previous path. + . <Relabsoluness> In general tab, it was possible to give longer modname than the fileformat could save. + . <Relabsoluness> Instruments associates with VSTis no longer also need to be associated to a sample in order to play. + . <Relabsoluness> Trash characters to empty ITP comments should no longer appear. + . <Relabsoluness> Channel state should now be updated correctly when e.g. moving channels through channel manager. + . <Relabsoluness> It should no longer be possible to remove all channels from channel manager. + / <Relabsoluness> Channel states resetting when jumping between orders from orderlist. + --> NOTE: While this fixes a bug (behavior change) introduced in the tuning branch(?), it also changes quite prominent behavior so can annoy people - might need to be modified at some point. + / <Relabsoluness> Added version number to the mainframe title. + / <Relabsoluness> Changed the 'order message' at the bottom bar of the screen "Position x of y" to "Position x of y (x in hex of y in hex)". + / <Relabsoluness> Lots of smaller (internal) changes. + +v1.17.02.45 + + <Relabsoluness & Alex> "Pitch to tempo lock" instrument setting: define the tempo at which your instrument loops correctly, and it will be pitched automatically to match the song's current tempo. + + <Relabsoluness> Notification when attempting to modify pattern but pattern record is off. + + <Relabsoluness> Orderlist margins: you can define how many slots to keep visible around the active pattern as the orderlist scrolls + . <Relabsoluness> Fixes for various unexpected pattern loop state changes. + . <Relabsoluness> Fixes to IT Style clear. + . <Relabsoluness> Memory management fixes and misc other bug fixes. + . <rewbs> ITP loading fixed (I broke it in v1.17.02.44) + . <rewbs> Time estimation fixed for tracks with pattern break+XParam. + . <rewbs> "Last saved with" version number was not always saved correctly - fixed + +v1.17.02.44 + + <rewbs> Added release section to volume envelope (see: http://openmpt.xwiki.com/xwiki/bin/view/Manual/InstrumentReleaseEnvelope). IT only. + . <rewbs> Overflow fixes in file loading functions (see: http://aluigi.altervista.org/adv/mptho-adv.txt) + . <rewbs> Greyed out irrelevant items in the orderlist context menu. + . v1.17.02.43 + <rewbs> You can now load up new plugins from anywhere, not just the General tab. Select "Plugin Manager..." from the view menu. This can also be assigned to a global hotkey. Limitation: currently plugins added to a song in this manner with always be put in the first empty slot. In a future version you'll be able to choose the slot directly from that window. @@ -16,6 +67,14 @@ . <rewbs> Added channel limit check when adding chans from the pattern editor. . <rewbs> Fixed instant crash with SampleTank 2.1. +. v1.17.02.43 + + <rewbs> You can now load up new plugins from anywhere, not just the General tab. Select "Plugin Manager..." from the view menu. This can also be assigned to a global hotkey. + Limitation: currently plugins added to a song in this manner with always be put in the first empty slot. In a future version you'll be able to choose the slot directly from that window. + + <rewbs> "Cleanup Plugins" to remove any plugs that are not associated to a channel and not used by an instrument and not used as an output for any used plugs. + . <rewbs> Fixed channel limits. Should be able to correctly save IT pattern data with up to 127 chans. There's only space for 64 channel headers though (channel names etc..). XMs restricted to 64 chans. + . <rewbs> Added channel limit check when adding chans from the pattern editor. + . <rewbs> Fixed instant crash with SampleTank 2.1. + . v1.17.02.42 + <rewbs> "Compatibility export" in file menu: save as 'plain' IT, without all of OpenMPT's crap. IT only for now (not XM). . <rewbs> Set instrument in pattern editor should work when no note is specified (tx Torvus - http://lpchip.com/modplug/viewtopic.php?t=470) Added: trunk/OpenMPT/packageTemplate/Installation.txt =================================================================== --- trunk/OpenMPT/packageTemplate/Installation.txt (rev 0) +++ trunk/OpenMPT/packageTemplate/Installation.txt 2007-05-07 11:41:47 UTC (rev 180) @@ -0,0 +1,5 @@ +OpenMPT development build - Installation notes +---------------------------------------------- +. If you have an existing installation of OpenMPT and wish to re-use its settings, copy your mptrack.ini to this directory. +. If not, you're done: just launch mptrack.exe. + Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb 2007-05-07 11:41:47 UTC (rev 180) @@ -9,7 +9,7 @@ 0:1349:2:83:1 //File/Save: Ctrl+S (KeyDown) 0:1030:2:119:1 //Play song/Pause song: Ctrl+F8 (KeyDown) 0:1031:0:119:1 //Pause song: F8 (KeyDown) -0:1375:0:27:1 //Stop Song: Esc (KeyDown) +0:1375:0:27:1 //Stop Song: ESC (KeyDown) 0:1029:0:116:5 //Play song from start: F5 (KeyDown|KeyHold) 0:1028:0:118:5 //Play song from cursor: F7 (KeyDown|KeyHold) 0:1027:0:117:5 //Play pattern from start: F6 (KeyDown|KeyHold) @@ -36,49 +36,49 @@ 0:1670:6:77:1 //View Channel Manager: Ctrl+Alt+M (KeyDown) 0:1669:3:77:1 //View Plugin Manager: Shift+Ctrl+M (KeyDown) 0:1032:0:219:5 //Previous instrument: [ (KeyDown|KeyHold) -0:1032:2:38:5 //Previous instrument: Ctrl+Up (KeyDown|KeyHold) +0:1032:2:38:5 //Previous instrument: Ctrl+UP (KeyDown|KeyHold) 0:1033:0:221:5 //Next instrument: ] (KeyDown|KeyHold) -0:1033:2:40:5 //Next instrument: Ctrl+Down (KeyDown|KeyHold) -0:1036:0:111:5 //Previous octave: Num / (KeyDown|KeyHold) -0:1037:0:106:5 //Next octave: Num * (KeyDown|KeyHold) -0:1034:2:37:5 //Previous order: Ctrl+Left (KeyDown|KeyHold) -0:1035:2:39:5 //Next order: Ctrl+Right (KeyDown|KeyHold) +0:1033:2:40:5 //Next instrument: Ctrl+DOWN (KeyDown|KeyHold) +0:1036:0:111:5 //Previous octave: NUM DIVIDE (KeyDown|KeyHold) +0:1037:0:106:5 //Next octave: NUMMULT (KeyDown|KeyHold) +0:1034:2:37:5 //Previous order: Ctrl+LEFT (KeyDown|KeyHold) +0:1035:2:39:5 //Next order: Ctrl+RIGHT (KeyDown|KeyHold) //----( General Context [bottom] (1) )------------ //----( Pattern Context [bottom] (2) )------------ -2:1017:0:34:5 //Jump down by measure: Page Down (KeyDown|KeyHold) -2:1018:0:33:5 //Jump up by measure: Page Up (KeyDown|KeyHold) -2:1338:4:34:5 //Jump down by beat: Alt+Page Down (KeyDown|KeyHold) -2:1339:4:33:5 //Jump up by beat: Alt+Page Up (KeyDown|KeyHold) -2:1019:2:34:5 //Snap down to measure: Ctrl+Page Down (KeyDown|KeyHold) -2:1020:2:33:5 //Snap up to measure: Ctrl+Page Up (KeyDown|KeyHold) -2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+Page Down (KeyDown|KeyHold) -2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+Page Up (KeyDown|KeyHold) -2:1038:0:40:5 //Navigate down by 1 row: Down (KeyDown|KeyHold) -2:1039:0:38:5 //Navigate up by 1 row: Up (KeyDown|KeyHold) -2:1040:0:37:5 //Navigate left: Left (KeyDown|KeyHold) -2:1041:0:39:5 //Navigate right: Right (KeyDown|KeyHold) -2:1042:0:9:5 //Navigate to next channel: Tab (KeyDown|KeyHold) -2:1043:2:9:5 //Navigate to previous channel: Ctrl+Tab (KeyDown|KeyHold) -2:1044:0:36:1 //Go to first channel: Home (KeyDown) -2:1045:2:36:1 //Go to first row: Ctrl+Home (KeyDown) -2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+Home (KeyDown) -2:1047:0:35:1 //Go to last channel: End (KeyDown) -2:1048:2:35:1 //Go to last row: Ctrl+End (KeyDown) -2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+End (KeyDown) -2:1050:1:16:1 //Selection key: Shift+Shift (KeyDown) +2:1017:0:34:5 //Jump down by measure: PGDOWN (KeyDown|KeyHold) +2:1018:0:33:5 //Jump up by measure: PGUP (KeyDown|KeyHold) +2:1338:4:34:5 //Jump down by beat: Alt+PGDOWN (KeyDown|KeyHold) +2:1339:4:33:5 //Jump up by beat: Alt+PGUP (KeyDown|KeyHold) +2:1019:2:34:5 //Snap down to measure: Ctrl+PGDOWN (KeyDown|KeyHold) +2:1020:2:33:5 //Snap up to measure: Ctrl+PGUP (KeyDown|KeyHold) +2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+PGDOWN (KeyDown|KeyHold) +2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+PGUP (KeyDown|KeyHold) +2:1038:0:40:5 //Navigate down by 1 row: DOWN (KeyDown|KeyHold) +2:1039:0:38:5 //Navigate up by 1 row: UP (KeyDown|KeyHold) +2:1040:0:37:5 //Navigate left: LEFT (KeyDown|KeyHold) +2:1041:0:39:5 //Navigate right: RIGHT (KeyDown|KeyHold) +2:1042:0:9:5 //Navigate to next channel: TAB (KeyDown|KeyHold) +2:1043:2:9:5 //Navigate to previous channel: Ctrl+TAB (KeyDown|KeyHold) +2:1044:0:36:1 //Go to first channel: HOME (KeyDown) +2:1045:2:36:1 //Go to first row: Ctrl+HOME (KeyDown) +2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+HOME (KeyDown) +2:1047:0:35:1 //Go to last channel: END (KeyDown) +2:1048:2:35:1 //Go to last row: Ctrl+END (KeyDown) +2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+END (KeyDown) +2:1050:1:16:1 //Selection key: Shift (KeyDown) 2:1011:4:76:1 //Select channel / Select all: Alt+L (KeyDown) 2:1663:2:118:1 //Toggle follow song: Ctrl+F7 (KeyDown) -2:1003:0:13:1 //Quick copy: Enter (KeyDown) -2:1004:0:32:5 //Quick paste: Space (KeyDown|KeyHold) +2:1003:0:13:1 //Quick copy: ENTER (KeyDown) +2:1004:0:32:5 //Quick paste: SPACE (KeyDown|KeyHold) 2:1001:1:120:1 //Enable recording: Shift+F9 (KeyDown) -2:1002:2:13:1 //Play row: Ctrl+Enter (KeyDown) -2:1002:0:104:1 //Play row: Num 8 (KeyDown) +2:1002:2:13:1 //Play row: Ctrl+ENTER (KeyDown) +2:1002:0:104:1 //Play row: NUM 8 (KeyDown) 2:1002:0:56:1 //Play row: 8 (KeyDown) -2:1317:4:18:1 //Set row jump on note entry: Alt+Alt (KeyDown) -2:1685:6:9:1 //Switch to order list: Ctrl+Alt+Tab (KeyDown) -2:1672:3:13:1 //Insert new pattern: Shift+Ctrl+Enter (KeyDown) +2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown) +2:1685:6:9:1 //Switch to order list: Ctrl+Alt+TAB (KeyDown) +2:1672:3:13:1 //Insert new pattern: Shift+Ctrl+ENTER (KeyDown) 2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown) 2:1062:0:93:1 //Show note properties: Application (KeyDown) 2:1063:2:93:1 //Show context (right-click) menu: Ctrl+Application (KeyDown) @@ -95,18 +95,18 @@ 2:1013:4:83:1 //Apply current instrument: Alt+S (KeyDown) 2:1660:4:69:1 //Grow selection: Alt+E (KeyDown) 2:1661:4:68:1 //Shrink selection: Alt+D (KeyDown) -2:1057:0:46:1 //Clear row: Delete (KeyDown) -2:1058:0:110:1 //Clear field: Num Del (KeyDown) +2:1057:0:46:1 //Clear row: DELETE (KeyDown) +2:1058:0:110:1 //Clear field: NUM DECIMAL (KeyDown) 2:1664:1:190:1 //Clear field (IT Style): Shift+. (KeyDown) -2:1059:2:46:1 //Clear row and step: Ctrl+Delete (KeyDown) -2:1060:2:110:1 //Clear field and step: Ctrl+Num Del (KeyDown) +2:1059:2:46:1 //Clear row and step: Ctrl+DELETE (KeyDown) +2:1060:2:110:1 //Clear field and step: Ctrl+NUM DECIMAL (KeyDown) 2:1665:3:190:1 //Clear field and step (IT Style): Shift+Ctrl+. (KeyDown) -2:1061:0:8:5 //Delete rows: Backspace (KeyDown|KeyHold) -2:1377:2:8:5 //Delete all rows: Ctrl+Backspace (KeyDown|KeyHold) -2:1378:0:45:5 //Insert Row: Insert (KeyDown|KeyHold) -2:1379:2:45:1 //Insert All Rows: Ctrl+Insert (KeyDown) -2:1055:0:109:5 //Previous pattern: Num - (KeyDown|KeyHold) -2:1054:0:107:5 //Next pattern: Num + (KeyDown|KeyHold) +2:1061:0:8:5 //Delete rows: BACKSPACE (KeyDown|KeyHold) +2:1377:2:8:5 //Delete all rows: Ctrl+BACKSPACE (KeyDown|KeyHold) +2:1378:0:45:5 //Insert Row: INSERT (KeyDown|KeyHold) +2:1379:2:45:1 //Insert All Rows: Ctrl+INSERT (KeyDown) +2:1055:0:109:5 //Previous pattern: NUM SUB (KeyDown|KeyHold) +2:1054:0:107:5 //Next pattern: NUM PLUS (KeyDown|KeyHold) //----( Pattern Context [bottom] - Note Col (3) )------------ 3:1064:0:90:1 //Base octave C: Z (KeyDown) @@ -138,67 +138,67 @@ 3:1090:0:79:1 //Base octave +2 D: O (KeyDown) 3:1091:0:48:1 //Base octave +2 D#: 0 (KeyDown) 3:1092:0:80:1 //Base octave +2 E: P (KeyDown) -3:1212:0:96:1 //Set octave 0: Num 0 (KeyDown) -3:1213:0:97:1 //Set octave 1: Num 1 (KeyDown) -3:1214:0:98:1 //Set octave 2: Num 2 (KeyDown) -3:1215:0:99:1 //Set octave 3: Num 3 (KeyDown) +3:1212:0:96:1 //Set octave 0: NUM 0 (KeyDown) +3:1213:0:97:1 //Set octave 1: NUM 1 (KeyDown) +3:1214:0:98:1 //Set octave 2: NUM 2 (KeyDown) +3:1215:0:99:1 //Set octave 3: NUM 3 (KeyDown) 3:1216:0:52:1 //Set octave 4: 4 (KeyDown) -3:1216:0:100:1 //Set octave 4: Num 4 (KeyDown) -3:1217:0:101:1 //Set octave 5: Num 5 (KeyDown) -3:1218:0:102:1 //Set octave 6: Num 6 (KeyDown) -3:1219:0:103:1 //Set octave 7: Num 7 (KeyDown) -3:1220:0:104:1 //Set octave 8: Num 8 (KeyDown) -3:1221:0:105:1 //Set octave 9: Num 9 (KeyDown) -3:1316:1:16:1 //Chord Modifier: Shift+Shift (KeyDown) +3:1216:0:100:1 //Set octave 4: NUM 4 (KeyDown) +3:1217:0:101:1 //Set octave 5: NUM 5 (KeyDown) +3:1218:0:102:1 //Set octave 6: NUM 6 (KeyDown) +3:1219:0:103:1 //Set octave 7: NUM 7 (KeyDown) +3:1220:0:104:1 //Set octave 8: NUM 8 (KeyDown) +3:1221:0:105:1 //Set octave 9: NUM 9 (KeyDown) +3:1316:1:16:1 //Chord Modifier: Shift (KeyDown) 3:1200:0:49:1 //Note cut: 1 (KeyDown) -3:1201:0:223:1 //Note off: (KeyDown) +3:1201:0:223:1 //Note off: ` (KeyDown) 3:1201:0:187:1 //Note off: = (KeyDown) 3:1667:1:49:1 //Note cut (don't remember instrument): Shift+1 (KeyDown) -3:1668:1:223:1 //Note off (don't remember instrument): Shift+ (KeyDown) +3:1668:1:223:1 //Note off (don't remember instrument): Shift+` (KeyDown) //----( Pattern Context [bottom] - Ins Col (4) )------------ -4:1202:0:96:1 //Set instrument digit 0: Num 0 (KeyDown) +4:1202:0:96:1 //Set instrument digit 0: NUM 0 (KeyDown) 4:1202:0:48:1 //Set instrument digit 0: 0 (KeyDown) -4:1203:0:97:1 //Set instrument digit 1: Num 1 (KeyDown) +4:1203:0:97:1 //Set instrument digit 1: NUM 1 (KeyDown) 4:1203:0:49:1 //Set instrument digit 1: 1 (KeyDown) -4:1204:0:98:1 //Set instrument digit 2: Num 2 (KeyDown) +4:1204:0:98:1 //Set instrument digit 2: NUM 2 (KeyDown) 4:1204:0:50:1 //Set instrument digit 2: 2 (KeyDown) -4:1205:0:99:1 //Set instrument digit 3: Num 3 (KeyDown) +4:1205:0:99:1 //Set instrument digit 3: NUM 3 (KeyDown) 4:1205:0:51:1 //Set instrument digit 3: 3 (KeyDown) -4:1206:0:100:1 //Set instrument digit 4: Num 4 (KeyDown) +4:1206:0:100:1 //Set instrument digit 4: NUM 4 (KeyDown) 4:1206:0:52:1 //Set instrument digit 4: 4 (KeyDown) -4:1207:0:101:1 //Set instrument digit 5: Num 5 (KeyDown) +4:1207:0:101:1 //Set instrument digit 5: NUM 5 (KeyDown) 4:1207:0:53:1 //Set instrument digit 5: 5 (KeyDown) -4:1208:0:102:1 //Set instrument digit 6: Num 6 (KeyDown) +4:1208:0:102:1 //Set instrument digit 6: NUM 6 (KeyDown) 4:1208:0:54:1 //Set instrument digit 6: 6 (KeyDown) -4:1209:0:103:1 //Set instrument digit 7: Num 7 (KeyDown) +4:1209:0:103:1 //Set instrument digit 7: NUM 7 (KeyDown) 4:1209:0:55:1 //Set instrument digit 7: 7 (KeyDown) 4:1210:0:56:1 //Set instrument digit 8: 8 (KeyDown) -4:1210:0:104:1 //Set instrument digit 8: Num 8 (KeyDown) -4:1211:0:105:1 //Set instrument digit 9: Num 9 (KeyDown) +4:1210:0:104:1 //Set instrument digit 8: NUM 8 (KeyDown) +4:1211:0:105:1 //Set instrument digit 9: NUM 9 (KeyDown) 4:1211:0:57:1 //Set instrument digit 9: 9 (KeyDown) //----( Pattern Context [bottom] - Vol Col (5) )------------ 5:1222:0:48:1 //Set volume digit 0: 0 (KeyDown) -5:1222:0:96:1 //Set volume digit 0: Num 0 (KeyDown) +5:1222:0:96:1 //Set volume digit 0: NUM 0 (KeyDown) 5:1223:0:49:1 //Set volume digit 1: 1 (KeyDown) -5:1223:0:97:1 //Set volume digit 1: Num 1 (KeyDown) +5:1223:0:97:1 //Set volume digit 1: NUM 1 (KeyDown) 5:1224:0:50:1 //Set volume digit 2: 2 (KeyDown) -5:1224:0:98:1 //Set volume digit 2: Num 2 (KeyDown) +5:1224:0:98:1 //Set volume digit 2: NUM 2 (KeyDown) 5:1225:0:51:1 //Set volume digit 3: 3 (KeyDown) -5:1225:0:99:1 //Set volume digit 3: Num 3 (KeyDown) +5:1225:0:99:1 //Set volume digit 3: NUM 3 (KeyDown) 5:1226:0:52:1 //Set volume digit 4: 4 (KeyDown) -5:1226:0:100:1 //Set volume digit 4: Num 4 (KeyDown) +5:1226:0:100:1 //Set volume digit 4: NUM 4 (KeyDown) 5:1227:0:53:1 //Set volume digit 5: 5 (KeyDown) -5:1227:0:101:1 //Set volume digit 5: Num 5 (KeyDown) +5:1227:0:101:1 //Set volume digit 5: NUM 5 (KeyDown) 5:1228:0:54:1 //Set volume digit 6: 6 (KeyDown) -5:1228:0:102:1 //Set volume digit 6: Num 6 (KeyDown) +5:1228:0:102:1 //Set volume digit 6: NUM 6 (KeyDown) 5:1229:0:55:1 //Set volume digit 7: 7 (KeyDown) -5:1229:0:103:1 //Set volume digit 7: Num 7 (KeyDown) +5:1229:0:103:1 //Set volume digit 7: NUM 7 (KeyDown) 5:1230:0:56:1 //Set volume digit 8: 8 (KeyDown) -5:1230:0:104:1 //Set volume digit 8: Num 8 (KeyDown) +5:1230:0:104:1 //Set volume digit 8: NUM 8 (KeyDown) 5:1231:0:57:1 //Set volume digit 9: 9 (KeyDown) -5:1231:0:105:1 //Set volume digit 9: Num 9 (KeyDown) +5:1231:0:105:1 //Set volume digit 9: NUM 9 (KeyDown) 5:1232:0:86:1 //Vol command - volume: V (KeyDown) 5:1233:0:80:1 //Vol command - pan: P (KeyDown) 5:1234:0:67:1 //Vol command - vol slide up: C (KeyDown) @@ -216,31 +216,31 @@ 5:1246:0:79:1 //Vol command - Offset: O (KeyDown) //----( Pattern Context [bottom] - FX Col (6) )------------ -6:1294:0:226:1 //FX midi macro slide: \ (KeyDown) +6:1294:0:220:1 //FX midi macro slide: \ (KeyDown) 6:1295:1:186:1 //FX pseudo-velocity (experimental): Shift+; (KeyDown) -6:1666:0:222:1 //FX parameter extension command: ' (KeyDown) +6:1666:0:222:1 //FX parameter extension command: # (KeyDown) //----( Pattern Context [bottom] - Param Col (7) )------------ 7:1247:0:48:1 //FX Param digit 0: 0 (KeyDown) -7:1247:0:96:1 //FX Param digit 0: Num 0 (KeyDown) +7:1247:0:96:1 //FX Param digit 0: NUM 0 (KeyDown) 7:1248:0:49:1 //FX Param digit 1: 1 (KeyDown) -7:1248:0:97:1 //FX Param digit 1: Num 1 (KeyDown) +7:1248:0:97:1 //FX Param digit 1: NUM 1 (KeyDown) 7:1249:0:50:1 //FX Param digit 2: 2 (KeyDown) -7:1249:0:98:1 //FX Param digit 2: Num 2 (KeyDown) +7:1249:0:98:1 //FX Param digit 2: NUM 2 (KeyDown) 7:1250:0:51:1 //FX Param digit 3: 3 (KeyDown) -7:1250:0:99:1 //FX Param digit 3: Num 3 (KeyDown) +7:1250:0:99:1 //FX Param digit 3: NUM 3 (KeyDown) 7:1251:0:52:1 //FX Param digit 4: 4 (KeyDown) -7:1251:0:100:1 //FX Param digit 4: Num 4 (KeyDown) +7:1251:0:100:1 //FX Param digit 4: NUM 4 (KeyDown) 7:1252:0:53:1 //FX Param digit 5: 5 (KeyDown) -7:1252:0:101:1 //FX Param digit 5: Num 5 (KeyDown) +7:1252:0:101:1 //FX Param digit 5: NUM 5 (KeyDown) 7:1253:0:54:1 //FX Param digit 6: 6 (KeyDown) -7:1253:0:102:1 //FX Param digit 6: Num 6 (KeyDown) +7:1253:0:102:1 //FX Param digit 6: NUM 6 (KeyDown) 7:1254:0:55:1 //FX Param digit 7: 7 (KeyDown) -7:1254:0:103:1 //FX Param digit 7: Num 7 (KeyDown) +7:1254:0:103:1 //FX Param digit 7: NUM 7 (KeyDown) 7:1255:0:56:1 //FX Param digit 8: 8 (KeyDown) -7:1255:0:104:1 //FX Param digit 8: Num 8 (KeyDown) +7:1255:0:104:1 //FX Param digit 8: NUM 8 (KeyDown) 7:1256:0:57:1 //FX Param digit 9: 9 (KeyDown) -7:1256:0:105:1 //FX Param digit 9: Num 9 (KeyDown) +7:1256:0:105:1 //FX Param digit 9: NUM 9 (KeyDown) 7:1257:0:65:1 //FX Param digit A: A (KeyDown) 7:1258:0:66:1 //FX Param digit B: B (KeyDown) 7:1259:0:67:1 //FX Param digit C: C (KeyDown) @@ -253,13 +253,13 @@ 8:1674:4:83:1 //Save Sample: Alt+S (KeyDown) 8:1675:4:78:1 //New Sample: Alt+N (KeyDown) 8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) -8:1383:0:8:1 //Silence sample selection: Backspace (KeyDown) +8:1383:0:8:1 //Silence sample selection: BACKSPACE (KeyDown) 8:1384:3:78:1 //Normalise Sample: Shift+Ctrl+N (KeyDown) 8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) 8:1381:3:82:1 //Reverse sample: Shift+Ctrl+R (KeyDown) -8:1382:0:46:1 //Delete sample selection: Delete (KeyDown) -8:1386:0:107:1 //Zoom Out: Num + (KeyDown) -8:1387:0:109:1 //Zoom In: Num - (KeyDown) +8:1382:0:46:1 //Delete sample selection: DELETE (KeyDown) +8:1386:0:107:1 //Zoom Out: NUM PLUS (KeyDown) +8:1387:0:109:1 //Zoom In: NUM SUB (KeyDown) //----( Instrument Context [bottom] (9) )------------ Added: trunk/OpenMPT/packageTemplate/tunings/standard/std_tunings.tc =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/tunings/standard/std_tunings.tc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2007-05-07 11:41:47 UTC (rev 180) @@ -638,7 +638,7 @@ case 'RPM.': fadr = reinterpret_cast<BYTE*>(&m_nRowsPerMeasure); break; case 'C...': fadr = reinterpret_cast<BYTE*>(&m_nChannels); break; case 'TM..': fadr = reinterpret_cast<BYTE*>(&m_nTempoMode); break; - case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nPlugMixMode); break; + case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nMixLevels); break; case 'CWV.': fadr = reinterpret_cast<BYTE*>(&m_dwCreatedWithVersion); break; case 'LSWV': fadr = reinterpret_cast<BYTE*>(&m_dwLastSavedWithVersion); break; case 'SPA.': fadr = reinterpret_cast<BYTE*>(&m_nSamplePreAmp); break; @@ -1044,7 +1044,7 @@ case 'RPM.': fadr = reinterpret_cast<BYTE*>(&m_nRowsPerMeasure); break; case 'C...': fadr = reinterpret_cast<BYTE*>(&m_nChannels); break; case 'TM..': fadr = reinterpret_cast<BYTE*>(&m_nTempoMode); break; - case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nPlugMixMode); break; + case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nMixLevels); break; case 'CWV.': fadr = reinterpret_cast<BYTE*>(&m_dwCreatedWithVersion); break; case 'LSWV': fadr = reinterpret_cast<BYTE*>(&m_dwLastSavedWithVersion); break; case 'SPA.': fadr = reinterpret_cast<BYTE*>(&m_nSamplePreAmp); break; @@ -3153,11 +3153,11 @@ fwrite(&size, 1, sizeof(__int16), f); fwrite(&m_nTempoMode, 1, size, f); - code = 'PMM.'; //write m_nPlugMixMode + code = 'PMM.'; //write m_nMixLevels fwrite(&code, 1, sizeof(__int32), f); - size = sizeof(m_nPlugMixMode); + size = sizeof(m_nMixLevels); fwrite(&size, 1, sizeof(__int16), f); - fwrite(&m_nPlugMixMode, 1, size, f); + fwrite(&m_nMixLevels, 1, size, f); code = 'CWV.'; //write m_dwCreatedWithVersion fwrite(&code, 1, sizeof(__int32), f); @@ -4309,7 +4309,7 @@ case 'RPM.': fadr = reinterpret_cast<BYTE*>(&m_nRowsPerMeasure); break; case 'C...': fadr = reinterpret_cast<BYTE*>(&m_nChannels); break; case 'TM..': fadr = reinterpret_cast<BYTE*>(&m_nTempoMode); break; - case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nPlugMixMode); break; + case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nMixLevels); break; case 'CWV.': fadr = reinterpret_cast<BYTE*>(&m_dwCreatedWithVersion); break; case 'LSWV': fadr = reinterpret_cast<BYTE*>(&m_dwLastSavedWithVersion); break; case 'SPA.': fadr = reinterpret_cast<BYTE*>(&m_nSamplePreAmp); break; Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2007-05-07 11:41:47 UTC (rev 180) @@ -641,7 +641,7 @@ case 'RPB.': fadr = reinterpret_cast<BYTE*>(&m_nRowsPerBeat); break; case 'RPM.': fadr = reinterpret_cast<BYTE*>(&m_nRowsPerMeasure); break; case 'TM..': fadr = reinterpret_cast<BYTE*>(&m_nTempoMode); break; - case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nPlugMixMode); break; + case 'PMM.': fadr = reinterpret_cast<BYTE*>(&m_nMixLevels); break; case 'CWV.': fadr = reinterpret_cast<BYTE*>(&m_dwCreatedWithVersion); break; case 'LSWV': fadr = reinterpret_cast<BYTE*>(&m_dwLastSavedWithVersion); break; case 'SPA.': fadr = reinterpret_cast<BYTE*>(&m_nSamplePreAmp); break; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2007-05-07 11:41:47 UTC (rev 180) @@ -435,7 +435,7 @@ memset(&m_SongEQ, 0, sizeof(m_SongEQ)); m_lTotalSampleCount=0; - m_nPlugMixMode=plugmix_mode_117RC2; + m_nMixLevels=mixLevels_117RC3; m_pConfig = new CSoundFilePlayConfig(); BuildDefaultInstrument(); @@ -690,7 +690,7 @@ } } } - m_pConfig->SetPluginMixLevels(m_nPlugMixMode); + m_pConfig->SetPluginMixLevels(m_nMixLevels); RecalculateGainForAllPlugs(); if (m_nType) Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/soundlib/Sndfile.h 2007-05-07 11:41:47 UTC (rev 180) @@ -897,7 +897,7 @@ UINT m_nRowsPerBeat; // rewbs.betterBPM UINT m_nRowsPerMeasure; // rewbs.betterBPM BYTE m_nTempoMode; // rewbs.betterBPM - BYTE m_nPlugMixMode; + BYTE m_nMixLevels; UINT m_nMusicSpeed, m_nMusicTempo; UINT m_nNextRow, m_nRow; UINT m_nPattern,m_nCurrentPattern,m_nNextPattern,m_nRestartPos, m_nSeqOverride; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2007-05-04 21:47:39 UTC (rev 179) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2007-05-07 11:41:47 UTC (rev 180) @@ -1618,10 +1618,7 @@ realvol = (pChn->nRealVolume * kChnMasterVol) >> 8; } - if (m_pConfig->getTreatPanLikeBalance()) { - pChn->nNewLeftVol = (realvol * pan) >> 8; - pChn->nNewRightVol = (realvol * (256 - pan)) >> 8; - } else { + if (m_pConfig->getForceSoftPanning() || gdwSoundSetup & SNDMIX_SOFTPANNING) { if (pan < 128) { pChn->nNewLeftVol = (realvol * pan) >> 8; pChn->nNewRightVol = (realvol * 128) >> 8; @@ -1629,6 +1626,9 @@ pChn->nNewLeftVol = (realvol * 128) >> 8; pChn->nNewRightVol = (realvol * (256 - pan)) >> 8; } + } else { + pChn->nNewLeftVol = (realvol * pan) >> 8; + pChn->nNewRightVol = (realvol * (256 - pan)) >> 8; } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <re...@us...> - 2007-05-07 13:39:03
|
Revision: 181 http://svn.sourceforge.net/modplug/?rev=181&view=rev Author: rewbs Date: 2007-05-07 06:34:49 -0700 (Mon, 07 May 2007) Log Message: ----------- . <rewbs> Fix odd window position on very first startup (before mptrack.ini is created). Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/bin/mptrack.exe trunk/OpenMPT/packageTemplate/History.txt Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2007-05-07 11:41:47 UTC (rev 180) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2007-05-07 13:34:49 UTC (rev 181) @@ -2933,7 +2933,8 @@ if (bShow && !IsWindowVisible() && firstShow) { firstShow = false; WINDOWPLACEMENT wpl; - GetPrivateProfileStruct("Display", "WindowPlacement", &wpl, sizeof(WINDOWPLACEMENT), theApp.GetConfigFileName()); - SetWindowPlacement(&wpl); + if (GetPrivateProfileStruct("Display", "WindowPlacement", &wpl, sizeof(WINDOWPLACEMENT), theApp.GetConfigFileName())) { + SetWindowPlacement(&wpl); + } } } Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2007-05-07 11:41:47 UTC (rev 180) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2007-05-07 13:34:49 UTC (rev 181) @@ -858,7 +858,7 @@ CString localVersion = CMainFrame::GetFullVersionString(); if (remoteVersion > localVersion) { CString message; - message.Format("New version available: %s. Would you like more information?", remoteVersion); + message.Format("New version available: %s (you are using %). Would you like more information?", remoteVersion, localVersion); if (AfxMessageBox(message, MB_ICONQUESTION|MB_YESNO ) == IDYES) { CString URL; URL.Format("http://openmpt.xwiki.com/xwiki/bin/view/Development/Builds?currentVersion=%s", localVersion); Modified: trunk/OpenMPT/mptrack/bin/mptrack.exe =================================================================== (Binary files differ) Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2007-05-07 11:41:47 UTC (rev 180) +++ trunk/OpenMPT/packageTemplate/History.txt 2007-05-07 13:34:49 UTC (rev 181) @@ -31,6 +31,7 @@ + <rewbs> New mixmode (called 1.17RC3): bypass global preamp, force soft panning, provide explicit dB value for sample attenuation. WARNING: this mixmode is subject to change. + <rewbs> Check for updates on startup. To disable, set CheckForUpdates=0 in mptrack.ini. . <rewbs> Plugin list window remembers its position/size even on cancel. + . <rewbs> Fix odd window position on very first startup (before mptrack.ini is created). . <Relabsoluness> When opening instruments, load dialog didn't remember its previous path. . <Relabsoluness> In general tab, it was possible to give longer modname than the fileformat could save. . <Relabsoluness> Instruments associates with VSTis no longer also need to be associated to a sample in order to play. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2007-05-12 20:04:58
|
Revision: 183 http://svn.sourceforge.net/modplug/?rev=183&view=rev Author: relabsoluness Date: 2007-05-12 13:04:56 -0700 (Sat, 12 May 2007) Log Message: ----------- / <Relabs> VS Edit&Continue fix(gone broken in 'RC3'branch) / <Relabs> Pattern skipping behavior returned to that of .45 / <Relabs> Minor modifications(cleanup of channel state reset code, removed unused orderundo-vector.) Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2007-05-09 19:57:16 UTC (rev 182) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2007-05-12 20:04:56 UTC (rev 183) @@ -207,7 +207,6 @@ pSndFile->m_nCurrentPattern = pSndFile->m_nNextPattern = m_nScrollPos; pMainFrm->ResetNotificationBuffer(); //rewbs.toCheck pSndFile->m_nNextRow = 0; - pSndFile->ResetChannelSettings(CHNRESET_BASIC); END_CRITICAL(); } else if (m_pParent->GetFollowSong()) @@ -217,13 +216,7 @@ pSndFile->m_nCurrentPattern = m_nScrollPos; pSndFile->SetCurrentOrder(m_nScrollPos); pSndFile->m_dwSongFlags |= dwPaused; - pSndFile->ResetChannelSettings(CHNRESET_BASIC); - - //if (!(dwPaused & SONG_PATTERNLOOP)) pSndFile->GetLength(TRUE); - //Relabs.note: Commented above line for it seems to cause - //significant slowdown when changing patterns without - //pattern-loop enabled. What is it's purpose anyway? - + if (!(dwPaused & SONG_PATTERNLOOP)) pSndFile->GetLength(TRUE); if (bIsPlaying) pMainFrm->ResetNotificationBuffer(); END_CRITICAL(); } Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2007-05-09 19:57:16 UTC (rev 182) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2007-05-12 20:04:56 UTC (rev 183) @@ -632,11 +632,8 @@ }; -//const CHAR gszBuildDate[] = __TIMESTAMP__; -const string buildDateTime = string(__DATE__) + string(" ") + string(__TIME__); +const CHAR gszBuildDate[] = __DATE__ " " __TIME__; - - ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2007-05-09 19:57:16 UTC (rev 182) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2007-05-12 20:04:56 UTC (rev 183) @@ -97,8 +97,6 @@ m_lpszLog = NULL; m_hWndFollow = NULL; memset(PatternUndo, 0, sizeof(PatternUndo)); - vector<BYTE> temp; temp.resize(MAX_UNDO_LEVEL, 0); - OrderUndo.resize(m_SndFile.Order.size(), temp); #ifdef _DEBUG MODCHANNEL *p = m_SndFile.Chn; if (((DWORD)p) & 7) Log("MODCHANNEL is not aligned (0x%08X)\n", p); @@ -2814,11 +2812,6 @@ BEGIN_CRITICAL(); - m_SndFile.SetCurrentPos(0); - //Relabs.note: Dirty hack to try to make replay pattern to be - //more like 'play song from start' - a little clean up for - //these playback calls would be nice (March 2007). - // Cut instruments/samples for (UINT i=0; i<MAX_CHANNELS; i++) { Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2007-05-09 19:57:16 UTC (rev 182) +++ trunk/OpenMPT/mptrack/Moddoc.h 2007-05-12 20:04:56 UTC (rev 183) @@ -88,7 +88,6 @@ HWND m_hWndFollow; DWORD m_dwNotifyType; PATTERNUNDOBUFFER PatternUndo[MAX_UNDO_LEVEL]; - vector<vector<BYTE> > OrderUndo; // -> CODE#0015 // -> DESC="channels management dlg" Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2007-05-09 19:57:16 UTC (rev 182) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2007-05-12 20:04:56 UTC (rev 183) @@ -462,7 +462,7 @@ if (i >= nRemainingChannels) { m_SndFile.Chn[i].dwFlags |= CHN_MUTE; - m_SndFile.SetChannelSettingsToDefault(i); + m_SndFile.InitChannel(i); } } } Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2007-05-09 19:57:16 UTC (rev 182) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2007-05-12 20:04:56 UTC (rev 183) @@ -1568,7 +1568,7 @@ CDialog::OnInitDialog(); m_bmp.SubclassDlgItem(IDC_BITMAP1, this); m_bmp.LoadBitmap(MAKEINTRESOURCE(IDB_MPTRACK)); - wsprintf(s, "Build Date: %s", buildDateTime.c_str()); + wsprintf(s, "Build Date: %s", gszBuildDate); SetDlgItemText(IDC_EDIT2, s); SetDlgItemText(IDC_EDIT3, CString("Open Modplug Tracker, version ") + CMainFrame::GetFullVersionString()); Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2007-05-09 19:57:16 UTC (rev 182) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2007-05-12 20:04:56 UTC (rev 183) @@ -2419,7 +2419,7 @@ BeginWaitCursor(); //First adding channel as the last channel... if (pModDoc->ChangeNumChannels(pSndFile->m_nChannels+1)) { - pSndFile->SetChannelSettingsToDefault(pSndFile->m_nChannels-1); + pSndFile->InitChannel(pSndFile->m_nChannels-1); //...and then moving it to right position. pSndFile->MoveChannel(pSndFile->m_nChannels-1, nChn); @@ -2443,7 +2443,7 @@ BeginWaitCursor(); if (pModDoc->ChangeNumChannels(pSndFile->m_nChannels+1)) { - pSndFile->SetChannelSettingsToDefault(pSndFile->m_nChannels-1); + pSndFile->InitChannel(pSndFile->m_nChannels-1); pSndFile->MoveChannel(pSndFile->m_nChannels-1, nChn); pModDoc->SetModified(); Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2007-05-09 19:57:16 UTC (rev 182) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2007-05-12 20:04:56 UTC (rev 183) @@ -1039,10 +1039,10 @@ //--------------------------------------- { UINT i, nPattern; - BYTE resetMask = (!nPos) ? CHNRESET_TOTAL : CHNRESET_MOST; + BYTE resetMask = (!nPos) ? CHNRESET_SETPOS_FULL : CHNRESET_SETPOS_BASIC; for (i=0; i<MAX_CHANNELS; i++) - ResetChannelSettings(i, resetMask); + ResetChannelState(i, resetMask); if (!nPos) { @@ -1341,61 +1341,33 @@ } -bool CSoundFile::SetChannelSettingsToDefault(UINT nch) +bool CSoundFile::InitChannel(UINT nch) //------------------------------------- { - //This is used to set default setting to new channels, - //so that a new channel for example won't have some plug in when created - might not do all defaultings, - //though. - - if(nch > MAX_BASECHANNELS) return true; + if(nch >= MAX_BASECHANNELS) return true; - ResetChannelSettings(nch, CHNRESET_TOTAL); - ChnSettings[nch].nPan = 128; ChnSettings[nch].nVolume = 64; ChnSettings[nch].dwFlags = 0; ChnSettings[nch].nMixPlugin = 0; ChnSettings[nch].szName[0] = 0; - Chn[nch].dwFlags = ChnSettings[nch].dwFlags; - Chn[nch].nPan = ChnSettings[nch].nPan; - Chn[nch].nGlobalVol = ChnSettings[nch].nVolume; + ResetChannelState(nch, CHNRESET_TOTAL); m_pModDoc->Record1Channel(nch,FALSE); m_pModDoc->Record2Channel(nch,FALSE); m_bChannelMuteTogglePending[nch] = false; - return false; } -void CSoundFile::ResetChannelSettings(CHANNELINDEX i, BYTE resetMask) +void CSoundFile::ResetChannelState(CHANNELINDEX i, BYTE resetMask) //------------------------------------------------------- { - //Relabs.Hack if(i >= MAX_CHANNELS) return; - if(resetMask & CHNRESET_BASIC) + if(resetMask & 2) { - if(i < MAX_BASECHANNELS) - { - //Chn[i].dwFlags = ChnSettings[i].dwFlags; - Chn[i].nPan = ChnSettings[i].nPan; - Chn[i].nGlobalVol = ChnSettings[i].nVolume; - } - else - { - Chn[i].dwFlags = 0; - Chn[i].nPan = 128; - Chn[i].nGlobalVol = 64; - } - - } - if(resetMask == CHNRESET_BASIC) return; - - if(resetMask & CHNRESET_MOST) - { Chn[i].nNote = Chn[i].nNewNote = Chn[i].nNewIns = 0; Chn[i].pInstrument = NULL; Chn[i].pHeader = NULL; @@ -1407,9 +1379,8 @@ Chn[i].dwFlags |= CHN_KEYOFF|CHN_NOTEFADE; Chn[i].nTremorCount = 0; } - if(resetMask == CHNRESET_MOST) return; - if(resetMask & CHNRESET_TOTAL) + if(resetMask & 4) { Chn[i].nPeriod = 0; Chn[i].nPos = Chn[i].nLength = 0; @@ -1427,17 +1398,26 @@ Chn[i].nLeftRamp = Chn[i].nRightRamp = 0; Chn[i].nVolume = 256; } -} -void CSoundFile::ResetChannelSettings(BYTE resetMask) -//------------------------------------- -{ - for(CHANNELINDEX i = 0; i<GetNumChannels(); i++) - ResetChannelSettings(i, resetMask); + if(resetMask & 1) + { + if(i < MAX_BASECHANNELS) + { + Chn[i].dwFlags = ChnSettings[i].dwFlags; + Chn[i].nPan = ChnSettings[i].nPan; + Chn[i].nGlobalVol = ChnSettings[i].nVolume; + } + else + { + Chn[i].dwFlags = 0; + Chn[i].nPan = 128; + Chn[i].nGlobalVol = 64; + } + + } } - CHANNELINDEX CSoundFile::ReArrangeChannels(const std::vector<CHANNELINDEX>& newOrder) //------------------------------------------------------------------- { @@ -1515,7 +1495,7 @@ } else { - SetChannelSettingsToDefault(i); + InitChannel(i); } } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2007-05-09 19:57:16 UTC (rev 182) +++ trunk/OpenMPT/soundlib/Sndfile.h 2007-05-12 20:04:56 UTC (rev 183) @@ -604,9 +604,10 @@ //<---- } MODCHANNEL; -#define CHNRESET_BASIC 1 -#define CHNRESET_MOST 3 -#define CHNRESET_TOTAL 255 +#define CHNRESET_CHNSETTINGS 1 // 1 b +#define CHNRESET_SETPOS_BASIC 2 // 10 b +#define CHNRESET_SETPOS_FULL 7 //111 b +#define CHNRESET_TOTAL 255 //11111111b typedef struct _MODCHANNELSETTINGS @@ -1001,17 +1002,10 @@ BOOL GetPatternName(UINT nPat, LPSTR lpszName, UINT cbSize=MAX_PATTERNNAME) const; CHANNELINDEX ReArrangeChannels(const std::vector<CHANNELINDEX>& fromToArray); bool MoveChannel(UINT chn_from, UINT chn_to); - bool SetChannelSettingsToDefault(UINT nch); - - //Sets default channels settings from MODCHANNELSETTINGS to current - //channel settings. Flag can be used to tell whether to completely - //reset channels, not only a few settings(for maintaining old behavior). - void ResetChannelSettings(CHANNELINDEX chn, BYTE resetStyle); - //For all channels. - void ResetChannelSettings(BYTE resetStyle); + bool InitChannel(UINT nch); + void ResetChannelState(CHANNELINDEX chn, BYTE resetStyle); - // Module Loaders BOOL ReadXM(LPCBYTE lpStream, DWORD dwMemLength); BOOL ReadS3M(LPCBYTE lpStream, DWORD dwMemLength); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <re...@us...> - 2007-05-13 11:17:22
|
Revision: 184 http://svn.sourceforge.net/modplug/?rev=184&view=rev Author: rewbs Date: 2007-05-13 04:17:15 -0700 (Sun, 13 May 2007) Log Message: ----------- v1.17.02.47 . <pelya> Save pattern scrollbar position when switching to other tabs . <pelya> If the cursor is moved but it is not on screen, move both horizontal and vertical scrollbars to make it visible. . <rewbs> Fix saturation on old modules (introduced in 1.17.02.46). Loading tracks with no saved mixlevel setting defaults to 'original'. Starting new IT, MPTM, ITP or XM defaults to '117RC3'. Starting new MOD or S3M defaults to 'original'. . <rewbs> Tree view FX list now starts with FX01 instead of FX00. / <Relabs> Pattern skipping behavior returned to that of .45 . <pelya & rewbs> intenal: ifdefs for compilation on vs2005 . <Relabs> intenal: VS Edit&Continue fix (gone broken in 'RC3'branch) / <Relabs> Minor modifications(cleanup of channel state reset code, removed unused orderundo-vector.) Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp trunk/OpenMPT/mptrack/SoundFilePlayConfig.h trunk/OpenMPT/mptrack/TuningDialog.h trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/bin/mptrack.exe trunk/OpenMPT/mptrack/bin/version trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/mptrack/patternContainer.cpp trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/mod_specifications.h Added Paths: ----------- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2007-05-13 11:17:15 UTC (rev 184) @@ -101,7 +101,8 @@ MODCHANNEL *p = m_SndFile.Chn; if (((DWORD)p) & 7) Log("MODCHANNEL is not aligned (0x%08X)\n", p); #endif - +// Fix: save pattern scrollbar position when switching to other tab + m_szOldPatternScrollbarsPos = CSize(-10,-10); // -> CODE#0015 // -> DESC="channels management dlg" ReinitRecordState(); @@ -134,20 +135,22 @@ m_SndFile.Create(NULL, this, 0); m_SndFile.ChangeModTypeTo(CTrackApp::GetDefaultDocType()); -// -> CODE#0023 -// -> DESC="IT project files (.itp)" - if(CTrackApp::IsProject()) m_SndFile.m_dwSongFlags |= SONG_ITPROJECT; -// -! NEW_FEATURE#0023 + if(CTrackApp::IsProject()) { + m_SndFile.m_dwSongFlags |= SONG_ITPROJECT; + } - if (m_SndFile.m_nType & (MOD_TYPE_XM|MOD_TYPE_IT | MOD_TYPE_MPT)) m_SndFile.m_dwSongFlags |= SONG_LINEARSLIDES; - //rewbs.MacroGUI: enable embedded macros by default. - if (m_SndFile.m_nType & (MOD_TYPE_XM|MOD_TYPE_IT | MOD_TYPE_MPT)) m_SndFile.m_dwSongFlags |= SONG_EMBEDMIDICFG; + if (m_SndFile.m_nType & (MOD_TYPE_XM | MOD_TYPE_IT | MOD_TYPE_MPT)) { + m_SndFile.m_dwSongFlags |= SONG_LINEARSLIDES; + m_SndFile.m_dwSongFlags |= SONG_EMBEDMIDICFG; + } + + // Refresh mix levels now that the correct mod type has been set + m_SndFile.m_nMixLevels=m_SndFile.GetModSpecifications()->defaultMixLevels; + m_SndFile.m_pConfig->SetMixLevels(m_SndFile.m_nMixLevels); + theApp.GetDefaultMidiMacro(&m_SndFile.m_MidiCfg); -// -> CODE#0015 -// -> DESC="channels management dlg" ReinitRecordState(); -// -! NEW_FEATURE#0015 InitializeMod(); SetModifiedFlag(FALSE); return TRUE; @@ -3119,3 +3122,4 @@ SetModified(); } } + Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/Moddoc.h 2007-05-13 11:17:15 UTC (rev 184) @@ -219,9 +219,14 @@ BOOL RemoveChannels(BOOL bChnMask[MAX_CHANNELS]); bool m_bHasValidPath; //becomes true if document is loaded or saved. +// Fix: save pattern scrollbar position when switching to other tab + CSize GetOldPatternScrollbarsPos() const { return m_szOldPatternScrollbarsPos; }; + void SetOldPatternScrollbarsPos( CSize s ){ m_szOldPatternScrollbarsPos = s; }; // protected members protected: + CSize m_szOldPatternScrollbarsPos; + BOOL InitializeMod(); void* GetChildFrame(); //rewbs.customKeys Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2007-05-13 11:17:15 UTC (rev 184) @@ -858,7 +858,7 @@ CString localVersion = CMainFrame::GetFullVersionString(); if (remoteVersion > localVersion) { CString message; - message.Format("New version available: %s (you are using %). Would you like more information?", remoteVersion, localVersion); + message.Format("New version available: %s (you are using %s). Would you like more information?", remoteVersion, localVersion); if (AfxMessageBox(message, MB_ICONQUESTION|MB_YESNO ) == IDYES) { CString URL; URL.Format("http://openmpt.xwiki.com/xwiki/bin/view/Development/Builds?currentVersion=%s", localVersion); @@ -1577,16 +1577,17 @@ MPC forums: http://lpchip.com/modplug/\r\n\ Robin Fernandes: mailto:mo...@so...\r\n\r\n\ Updates:\r\n\ -http://lpchip.com/modplug/viewtopic.php?t=18"); +http://modplug.sourceforge.net/builds/#dev"); char *pArrCredit = { "OpenMPT / Modplug Tracker|" - "Copyright \xA9 2004-2005 GPL|" + "Copyright \xA9 2004-2007 GPL|" "Copyright \xA9 1997-2003 Olivier Lapicque (ol...@mo...)|" "|" - "Development:|" - "Robin Fernandes: mo...@so... (2004-2006)|" - "rel...@us... (2005-2006)|" + "Contributors:|" + "Robin Fernandes: ro...@so... (2004-2007)|" + "Ahti Leppan: rel...@us... (2005-2007)|" + "Sergiy Pylypenko: x.p...@gm... (2007)|" "Eric Chavanon: co...@er... (2004-2005)|" "Trevor Nunes: mo...@pl... (2004)|" "Olivier Lapicque: ol...@mo... (1997-2003)|" @@ -1605,8 +1606,8 @@ "http://tinyurl.com/4yze8||" "...and to the following for ideas, testing and support:|" "LPChip, Ganja, Diamond, Nofold, Goor00,|" - "Georg, Skilletaudio, Squirrel Havoc, Snu,|" - "Anboi, Sam Zen, BooT-SectoR-ViruZ, 33, Waxhead,|" + "Georg, Skilletaudio, Squirrel Havoc, Snu, Anboi,|" + "Sam Zen, BooT-SectoR-ViruZ, 33, Waxhead, Jojo,|" "all at the MPC forums.|" "||||||" }; Modified: trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp =================================================================== --- trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/SoundFilePlayConfig.cpp 2007-05-13 11:17:15 UTC (rev 184) @@ -1,17 +1,14 @@ #include "stdafx.h" #include ".\soundfileplayconfig.h" -CSoundFilePlayConfig::CSoundFilePlayConfig(void) -{ - SetPluginMixLevels(mixLevels_117RC3); +CSoundFilePlayConfig::CSoundFilePlayConfig(void) { setVSTiVolume(1.0f); } -CSoundFilePlayConfig::~CSoundFilePlayConfig(void) -{ +CSoundFilePlayConfig::~CSoundFilePlayConfig(void) { } -void CSoundFilePlayConfig::SetPluginMixLevels(int mixLevelType) { +void CSoundFilePlayConfig::SetMixLevels(int mixLevelType) { switch (mixLevelType) { // Olivier's version gives us floats in [-0.5; 0.5] and slightly saturates VSTis. @@ -119,7 +116,6 @@ void CSoundFilePlayConfig::setVSTiVolume(float inVSTiVolume) { m_VSTiVolume = inVSTiVolume; - m_VSTiGainFactor = m_VSTiAttenuation*m_VSTiVolume; } float CSoundFilePlayConfig::getVSTiAttenuation() { @@ -127,8 +123,7 @@ } void CSoundFilePlayConfig::setVSTiAttenuation(float inVSTiAttenuation) { - m_VSTiAttenuation=inVSTiAttenuation; - m_VSTiGainFactor = m_VSTiAttenuation*m_VSTiVolume; + m_VSTiAttenuation = inVSTiAttenuation; } float CSoundFilePlayConfig::getIntToFloat() { Modified: trunk/OpenMPT/mptrack/SoundFilePlayConfig.h =================================================================== --- trunk/OpenMPT/mptrack/SoundFilePlayConfig.h 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/SoundFilePlayConfig.h 2007-05-13 11:17:15 UTC (rev 184) @@ -27,7 +27,7 @@ CSoundFilePlayConfig(void); ~CSoundFilePlayConfig(void); - void SetPluginMixLevels(int mixLevelType); + void SetMixLevels(int mixLevelType); //getters/setters float getIntToFloat(); @@ -72,7 +72,6 @@ float m_FloatToInt; float m_VSTiAttenuation; float m_VSTiVolume; - float m_VSTiGainFactor; // always m_VSTiAttenuation * m_VSTiVolume. No public setter. float m_normalSamplePreAmp; float m_normalVSTiVol; Modified: trunk/OpenMPT/mptrack/TuningDialog.h =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.h 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/TuningDialog.h 2007-05-13 11:17:15 UTC (rev 184) @@ -83,10 +83,10 @@ } private: + //Elements are collected to two arrays so that elements with the + //same index are mapped to each other. vector<T1> m_T1; vector<T2> m_T2; - //Elements are collected to two arrays so that elements with the - //same index are mapped to each other. T1 m_NotFoundT1; T2 m_NotFoundT2; Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2007-05-13 11:17:15 UTC (rev 184) @@ -229,8 +229,6 @@ CModDoc *pModDoc = GetDocument(); if (!pModDoc) return FALSE; pSndFile = pModDoc->GetSoundFile(); - CRect rect; - UINT yofs = GetYScrollPos(); if ((bWrap) && (pSndFile->PatternSize[m_nPattern])) { @@ -295,43 +293,11 @@ //end rewbs.fix3168 if ((row >= pSndFile->PatternSize[m_nPattern]) || (!m_szCell.cy)) return FALSE; - GetClientRect(&rect); - rect.top += m_szHeader.cy; - int numrows = (rect.bottom - rect.top - 1) / m_szCell.cy; - if (numrows < 1) numrows = 1; - if (m_nMidRow) - { - UINT newofs = row; - InvalidateRow(); - if (newofs != yofs) - { - CSize sz; - sz.cx = 0; - sz.cy = (int)(newofs - yofs) * m_szCell.cy; - OnScrollBy(sz, TRUE); - } - m_nRow = row; - InvalidateRow(); - } else - { - InvalidateRow(); - if (row < yofs) - { - CSize sz; - sz.cx = 0; - sz.cy = (int)(row - yofs) * m_szCell.cy; - OnScrollBy(sz, TRUE); - } else - if (row > yofs + (UINT)numrows - 1) - { - CSize sz; - sz.cx = 0; - sz.cy = (int)(row - yofs - numrows + 1) * m_szCell.cy; - OnScrollBy(sz, TRUE); - } - m_nRow = row; - InvalidateRow(); - } + // Fix: If cursor isn't on screen move both scrollbars to make it visible + InvalidateRow(); + m_nRow = row; + UpdateScrollbarPositions(); //UpdateScrollbarPositions( false ); // default behavior is to move only vertical scrollbar + InvalidateRow(); int sel = m_dwCursor | (m_nRow << 16); int sel0 = sel; if ((m_dwStatus & (PATSTATUS_KEYDRAGSEL|PATSTATUS_MOUSEDRAGSEL)) @@ -373,34 +339,90 @@ if ((m_dwStatus & (PATSTATUS_KEYDRAGSEL|PATSTATUS_MOUSEDRAGSEL)) && (!(m_dwStatus & PATSTATUS_DRAGNDROPEDIT))) sel0 = m_dwStartSel; SetCurSel(sel0, sel); - int xofs = GetXScrollPos(); - int nchn = ncol >> 3; - if (nchn < xofs) + // Fix: If cursor isn't on screen move both scrollbars to make it visible + UpdateScrollbarPositions(); + UpdateIndicator(); + return TRUE; +} + +// Fix: If cursor isn't on screen move scrollbars to make it visible +// Fix: save pattern scrollbar position when switching to other tab +// Assume that m_nRow and m_dwCursor are valid +// When we switching to other tab the CViewPattern object is deleted +// and when switching back new one is created +BOOL CViewPattern::UpdateScrollbarPositions( bool UpdateHorizontalScrollbar ) +{ +// HACK - after new CViewPattern object created SetCurrentRow() and SetCurrentColumn() are called - +// just skip first two calls of UpdateScrollbarPositions() if pModDoc->GetOldPatternScrollbarsPos() is valid + CModDoc *pModDoc = GetDocument(); + if (pModDoc) { - CSize size(0,0); - size.cx = nchn * m_szCell.cx - GetScrollPos(SB_HORZ); - UpdateWindow(); - if (OnScrollBy(size, TRUE)) UpdateWindow(); + CSize scroll = pModDoc->GetOldPatternScrollbarsPos(); + if( scroll.cx >= 0 ) + { + OnScrollBy( scroll ); + scroll.cx = -1; + pModDoc->SetOldPatternScrollbarsPos( scroll ); + return TRUE; + } else + if( scroll.cx >= -1 ) + { + scroll.cx = -2; + pModDoc->SetOldPatternScrollbarsPos( scroll ); + return TRUE; + } + } + CSize scroll(0,0); + UINT row = GetCurrentRow(); + UINT yofs = GetYScrollPos(); + CRect rect; + GetClientRect(&rect); + rect.top += m_szHeader.cy; + int numrows = (rect.bottom - rect.top - 1) / m_szCell.cy; + if (numrows < 1) numrows = 1; + if (m_nMidRow) + { + if (row != yofs) + { + scroll.cy = (int)(row - yofs) * m_szCell.cy; + } } else - if (nchn > xofs) { - CRect rect; - GetClientRect(&rect); - UINT nw = GetColumnWidth(); - int maxcol = (rect.right - m_szHeader.cx) / nw; - if ((nchn >= (xofs+maxcol)) && (maxcol >= 0)) + if (row < yofs) { - CSize size(0,0); - size.cx = (nchn - maxcol + 1) * m_szCell.cx - GetScrollPos(SB_HORZ); - UpdateWindow(); - if (OnScrollBy(size, TRUE)) UpdateWindow(); + scroll.cy = (int)(row - yofs) * m_szCell.cy; + } else + if (row > yofs + (UINT)numrows - 1) + { + scroll.cy = (int)(row - yofs - numrows + 1) * m_szCell.cy; } } - UpdateIndicator(); + + if( UpdateHorizontalScrollbar ) + { + UINT ncol = GetCurrentColumn(); + UINT xofs = GetXScrollPos(); + int nchn = ncol >> 3; + if (nchn < xofs) + { + scroll.cx = (int)(nchn - xofs) * m_szCell.cx; + } else + if (nchn > xofs) + { + int maxcol = (rect.right - m_szHeader.cx) / m_szCell.cx; + if ((nchn >= (xofs+maxcol)) && (maxcol >= 0)) + { + scroll.cx = (int)(nchn - xofs - maxcol + 1) * m_szCell.cx; + } + } + } + if( scroll.cx != 0 || scroll.cy != 0 ) + { + OnScrollBy(scroll, TRUE); + } return TRUE; } - DWORD CViewPattern::GetDragItem(CPoint point, LPRECT lpRect) //---------------------------------------------------------- { @@ -622,6 +644,13 @@ void CViewPattern::OnDestroy() //---------------------------- { +// Fix: save pattern scrollbar position when switching to other tab +// When we switching to other tab the CViewPattern object is deleted + CModDoc *pModDoc = GetDocument(); + if (pModDoc) + { + pModDoc->SetOldPatternScrollbarsPos(CSize(m_nXScroll*m_szCell.cx, m_nYScroll*m_szCell.cy)); + }; if (m_pEffectVis) { m_pEffectVis->DoClose(); delete m_pEffectVis; @@ -4887,3 +4916,4 @@ + Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/View_pat.h 2007-05-13 11:17:15 UTC (rev 184) @@ -153,6 +153,8 @@ BOOL SetCurrentColumn(UINT ncol); BOOL DragToSel(DWORD dwPos, BOOL bScroll, BOOL bNoMove=FALSE); BOOL SetPlayCursor(UINT nPat, UINT nRow); +// Fix: If cursor isn't on screen move scrollbars to make it visible + BOOL UpdateScrollbarPositions( bool UpdateHorizontalScrollbar=true ); // -> CODE#0014 // -> DESC="vst wet/dry slider" // BOOL EnterNote(UINT nNote, UINT nIns=0, BOOL bCheck=FALSE, int vol=-1, BOOL bMultiCh=FALSE); @@ -351,3 +353,4 @@ #endif + Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2007-05-13 11:17:15 UTC (rev 184) @@ -672,7 +672,7 @@ { pInfo->hEffects = InsertItem("Plugins", IMAGE_FOLDER, IMAGE_FOLDER, pInfo->hSong, TVI_LAST); } - wsprintf(s, "FX%d: %s", iFx, pPlugin->Info.szName); + wsprintf(s, "FX%d: %s", iFx+1, pPlugin->Info.szName); pInfo->tiEffects[iFx] = InsertItem(s, IMAGE_WAVEOUT, IMAGE_WAVEOUT, pInfo->hEffects, TVI_LAST); nFx++; } Modified: trunk/OpenMPT/mptrack/bin/mptrack.exe =================================================================== (Binary files differ) Modified: trunk/OpenMPT/mptrack/bin/version =================================================================== --- trunk/OpenMPT/mptrack/bin/version 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/bin/version 2007-05-13 11:17:15 UTC (rev 184) @@ -1 +1 @@ -1.17.02.46 \ No newline at end of file +1.17.02.47 \ No newline at end of file Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2007-05-13 11:17:15 UTC (rev 184) @@ -384,7 +384,7 @@ sel = m_PlugMixBox.GetCurSel(); if (sel >= 0) { m_pSndFile->m_nMixLevels = m_PlugMixBox.GetItemData(sel); - m_pSndFile->m_pConfig->SetPluginMixLevels(m_pSndFile->m_nMixLevels); + m_pSndFile->m_pConfig->SetMixLevels(m_pSndFile->m_nMixLevels); m_pSndFile->RecalculateGainForAllPlugs(); } Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/mptrack.rc 2007-05-13 11:17:15 UTC (rev 184) @@ -1926,7 +1926,7 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,17,2,46 + FILEVERSION 1,17,2,47 PRODUCTVERSION 0,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG @@ -1944,7 +1944,7 @@ BEGIN VALUE "CompanyName", "Olivier Lapicque / OpenMPT team" VALUE "FileDescription", "OpenMPT / ModPlug Tracker" - VALUE "FileVersion", "1, 17, 2, 46" + VALUE "FileVersion", "1, 17, 2, 47" VALUE "InternalName", "Modplug Tracker" VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2007 GPL." VALUE "LegalTrademarks", "M.O.D.P.L.U.G" Modified: trunk/OpenMPT/mptrack/mptrack.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack.vcproj 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/mptrack.vcproj 2007-05-13 11:17:15 UTC (rev 184) @@ -1079,6 +1079,9 @@ RelativePath=".\tuningRatioMapWnd.h"> </File> <File + RelativePath=".\typedefs.h"> + </File> + <File RelativePath=".\view_com.h"> </File> <File Modified: trunk/OpenMPT/mptrack/patternContainer.cpp =================================================================== --- trunk/OpenMPT/mptrack/patternContainer.cpp 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/mptrack/patternContainer.cpp 2007-05-13 11:17:15 UTC (rev 184) @@ -59,10 +59,10 @@ return m_Patterns.size(); } +//NOTE: Various methods around the code are, unsurprisingly, bounded to the way things +//were handled with 0xFE and 0xFF, so changing these return values might cause problems. UINT CPatternContainer::GetInvalidIndex() const {return m_rSndFile.m_nType == MOD_TYPE_MPT ? LIMIT_UINT_MAX : 0xFF;} UINT CPatternContainer::GetIgnoreIndex() const {return m_rSndFile.m_nType == MOD_TYPE_MPT ? LIMIT_UINT_MAX-1 : 0xFE;} -//NOTE: Various methods around the code are, unsurprisingly, bounded to the way things -//were handled with 0xFE and 0xFF, so changing these return values might cause problems. UINT CPatternContainer::GetPatternNumberLimitMax() const //------------------------------------------------------- Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/packageTemplate/History.txt 2007-05-13 11:17:15 UTC (rev 184) @@ -8,6 +8,18 @@ ?: other (tx XYZ): thanks to XYZ for telling me about the bug +v1.17.02.47 + ? <rewbs> An update checker was introduced in the previous version. If you had any problems with the update notification, please report a bug. + . <pelya> Save pattern scrollbar position when switching to other tabs + . <pelya> If the cursor is moved but it is not on screen, move both horizontal and vertical scrollbars to make it visible. + . <rewbs> Fix saturation on old modules (introduced in 1.17.02.46). Loading tracks with no saved mixlevel setting defaults to 'original'. + Starting new IT, MPTM, ITP or XM defaults to '117RC3'. Starting new MOD or S3M defaults to 'original'. + . <rewbs> Tree view FX list now starts with FX01 instead of FX00. + / <Relabs> Pattern skipping behavior returned to that of .45 + . <pelya & rewbs> internal: ifdefs for compilation on vs2005 + . <Relabs> internal: VS Edit&Continue fix (gone broken in 'RC3'branch) + / <Relabs> Minor modifications(cleanup of channel state reset code, removed unused orderundo-vector.) + v1.17.02.46 + <Relabsoluness> Experimental MPTm format: --> Internally, it is still very close to the IT-based format. @@ -680,4 +692,4 @@ Questions/comments/bug reports? ------------------------------- -Visit http://www.modplug.com/forums, or write to ro...@so.... \ No newline at end of file +Visit http://modplug.sourceforge.net/forum. \ No newline at end of file Added: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb (rev 0) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2007-05-13 11:17:15 UTC (rev 184) @@ -0,0 +1,269 @@ +//-------- OpenMPT key binding definition file ------- +//-Format is: - +//- Context:Command ID:Modifiers:Key:KeypressEventType //Comments - +//---------------------------------------------------------------------- + +//----( Global Context (0) )------------ +0:1347:2:78:1 //File/New: Ctrl+N (KeyDown) +0:1346:2:79:1 //File/Open: Ctrl+O (KeyDown) +0:1349:2:83:1 //File/Save: Ctrl+S (KeyDown) +0:1030:0:116:1 //Play song/Pause song: F5 (KeyDown) +0:1031:0:119:1 //Pause song: F8 (KeyDown) +0:1375:0:27:1 //Stop Song: ESC (KeyDown) +0:1029:0:117:1 //Play song from start: F6 (KeyDown) +0:1027:0:118:5 //Play pattern from start: F7 (KeyDown|KeyHold) +0:1026:2:118:5 //Play pattern from cursor: Ctrl+F7 (KeyDown|KeyHold) +0:1376:0:120:1 //Toggle Midi Record: F9 (KeyDown) +0:1359:2:90:1 //Undo: Ctrl+Z (KeyDown) +0:1360:2:88:1 //Cut: Ctrl+X (KeyDown) +0:1361:2:67:1 //Copy: Ctrl+C (KeyDown) +0:1361:2:45:1 //Copy: Ctrl+EINFG (KeyDown) +0:1362:2:86:1 //Paste: Ctrl+V (KeyDown) +0:1362:1:45:1 //Paste: Shift+EINFG (KeyDown) +0:1364:2:53:1 //SelectAll: Ctrl+5 (KeyDown) +0:1365:2:70:1 //Find: Ctrl+F (KeyDown) +0:1366:0:114:1 //Find Next: F3 (KeyDown) +0:1021:4:71:1 //View General: Alt+G (KeyDown) +0:1022:4:80:1 //View Pattern: Alt+P (KeyDown) +0:1023:4:83:1 //View Samples: Alt+S (KeyDown) +0:1024:4:78:1 //View Instruments: Alt+N (KeyDown) +0:1025:1:120:1 //View Comments: Shift+F9 (KeyDown) +0:1368:2:113:1 //Toggle Tree View: Ctrl+F2 (KeyDown) +0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown) +0:1370:0:112:1 //Help (to do): F1 (KeyDown) +0:1032:2:111:5 //Previous instrument: Ctrl+ (ZEHNERTASTATUR) (KeyDown|KeyHold) +0:1032:2:38:5 //Previous instrument: Ctrl+NACH-OBEN (KeyDown|KeyHold) +0:1033:2:106:5 //Next instrument: Ctrl+ (ZEHNERTASTATUR) (KeyDown|KeyHold) +0:1033:2:40:5 //Next instrument: Ctrl+NACH-UNTEN (KeyDown|KeyHold) +0:1036:0:111:1 //Previous octave: (ZEHNERTASTATUR) (KeyDown) +0:1037:0:106:1 //Next octave: (ZEHNERTASTATUR) (KeyDown) +0:1034:2:37:5 //Previous order: Ctrl+NACH-LINKS (KeyDown|KeyHold) +0:1035:2:39:5 //Next order: Ctrl+NACH-RECHTS (KeyDown|KeyHold) + +//----( General Context [bottom] (1) )------------ + +//----( Pattern Context [bottom] (2) )------------ +2:1338:0:34:5 //Jump down by beat: BILD-NACH-UNTEN (KeyDown|KeyHold) +2:1339:0:33:5 //Jump up by beat: BILD-NACH-OBEN (KeyDown|KeyHold) +2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+BILD-NACH-UNTEN (KeyDown|KeyHold) +2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+BILD-NACH-OBEN (KeyDown|KeyHold) +2:1038:0:40:5 //Navigate down by 1 row: NACH-UNTEN (KeyDown|KeyHold) +2:1039:0:38:5 //Navigate up by 1 row: NACH-OBEN (KeyDown|KeyHold) +2:1040:0:37:5 //Navigate left: NACH-LINKS (KeyDown|KeyHold) +2:1041:0:39:5 //Navigate right: NACH-RECHTS (KeyDown|KeyHold) +2:1042:0:9:1 //Navigate to next channel: TABULATOR (KeyDown) +2:1043:1:9:1 //Navigate to previous channel: Shift+TABULATOR (KeyDown) +2:1044:0:36:1 //Go to first channel: POS1 (KeyDown) +2:1045:2:36:1 //Go to first row: Ctrl+POS1 (KeyDown) +2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+POS1 (KeyDown) +2:1047:0:35:1 //Go to last channel: ENDE (KeyDown) +2:1048:2:35:1 //Go to last row: Ctrl+ENDE (KeyDown) +2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+ENDE (KeyDown) +2:1050:1:16:1 //Selection key: Shift+UMSCHALT (KeyDown) +2:1011:2:76:1 //Select channel / Select all: Ctrl+L (KeyDown) +2:1003:0:13:1 //Quick copy: EINGABE (KeyDown) +2:1004:0:32:5 //Quick paste: LEER (KeyDown|KeyHold) +2:1001:2:32:1 //Enable recording: Ctrl+LEER (KeyDown) +2:1002:2:13:5 //Play row: Ctrl+EINGABE (KeyDown|KeyHold) +2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown) +2:1685:2:9:1 //Switch to order list: Ctrl+TABULATOR (KeyDown) +2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown) +2:1062:0:93:1 //Show note properties: ANWENDUNG (KeyDown) +2:1007:2:81:5 //Transpose +1: Ctrl+Q (KeyDown|KeyHold) +2:1008:2:65:5 //Transpose -1: Ctrl+A (KeyDown|KeyHold) +2:1009:3:81:5 //Transpose +12: Shift+Ctrl+Q (KeyDown|KeyHold) +2:1010:3:65:5 //Transpose -12: Shift+Ctrl+A (KeyDown|KeyHold) +2:1012:2:77:1 //Amplify selection: Ctrl+M (KeyDown) +2:1014:2:74:1 //Interpolate volume: Ctrl+J (KeyDown) +2:1015:2:75:1 //Interpolate effect: Ctrl+K (KeyDown) +2:1016:4:66:1 //Open effect visualizer: Alt+B (KeyDown) +2:1013:2:73:1 //Apply current instrument: Ctrl+I (KeyDown) +2:1660:4:69:5 //Grow selection: Alt+E (KeyDown|KeyHold) +2:1661:4:68:5 //Shrink selection: Alt+D (KeyDown|KeyHold) +2:1059:2:46:1 //Clear row and step: Ctrl+ENTF (KeyDown) +2:1665:0:46:1 //Clear field and step (IT Style): ENTF (KeyDown) +2:1061:0:8:5 //Delete rows: R\xDCCK (KeyDown|KeyHold) +2:1377:2:8:5 //Delete all rows: Ctrl+R\xDCCK (KeyDown|KeyHold) +2:1378:0:45:1 //Insert Row: EINFG (KeyDown) +2:1379:2:45:1 //Insert All Rows: Ctrl+EINFG (KeyDown) +2:1055:0:109:5 //Previous pattern: - (ZEHNERTASTATUR) (KeyDown|KeyHold) +2:1054:0:107:5 //Next pattern: + (ZEHNERTASTATUR) (KeyDown|KeyHold) + +//----( Pattern Context [bottom] - Note Col (3) )------------ +3:1064:0:81:1 //Base octave C: Q (KeyDown) +3:1065:0:87:1 //Base octave C#: W (KeyDown) +3:1066:0:69:1 //Base octave D: E (KeyDown) +3:1067:0:82:1 //Base octave D#: R (KeyDown) +3:1068:0:84:1 //Base octave E: T (KeyDown) +3:1069:0:90:1 //Base octave F: Z (KeyDown) +3:1070:0:85:1 //Base octave F#: U (KeyDown) +3:1071:0:73:1 //Base octave G: I (KeyDown) +3:1072:0:79:1 //Base octave G#: O (KeyDown) +3:1073:0:80:1 //Base octave +1 A: P (KeyDown) +3:1074:0:186:1 //Base octave +1 A#: \xFC (KeyDown) +3:1075:0:187:1 //Base octave +1 B: + (KeyDown) +3:1076:0:65:1 //Base octave +1 C: A (KeyDown) +3:1077:0:83:1 //Base octave +1 C#: S (KeyDown) +3:1078:0:68:1 //Base octave +1 D: D (KeyDown) +3:1079:0:70:1 //Base octave +1 D#: F (KeyDown) +3:1080:0:71:1 //Base octave +1 E: G (KeyDown) +3:1081:0:72:1 //Base octave +1 F: H (KeyDown) +3:1082:0:74:1 //Base octave +1 F#: J (KeyDown) +3:1083:0:75:1 //Base octave +1 G: K (KeyDown) +3:1084:0:76:1 //Base octave +1 G#: L (KeyDown) +3:1085:0:192:1 //Base octave +2 A: \xF6 (KeyDown) +3:1086:0:222:1 //Base octave +2 A#: \xE4 (KeyDown) +3:1087:0:191:1 //Base octave +2 B: # (KeyDown) +3:1088:0:89:1 //Base octave +2 C: Y (KeyDown) +3:1089:0:88:1 //Base octave +2 C#: X (KeyDown) +3:1090:0:67:1 //Base octave +2 D: C (KeyDown) +3:1091:0:86:1 //Base octave +2 D#: V (KeyDown) +3:1092:0:66:1 //Base octave +2 E: B (KeyDown) +3:1093:0:78:1 //Base octave +2 F: N (KeyDown) +3:1094:0:77:1 //Base octave +2 F#: M (KeyDown) +3:1095:0:188:1 //Base octave +2 G: , (KeyDown) +3:1096:0:190:1 //Base octave +2 G#: . (KeyDown) +3:1097:0:189:1 //Base octave +3 A: - (KeyDown) +3:1212:0:48:1 //Set octave 0: 0 (KeyDown) +3:1212:0:96:1 //Set octave 0: 0 (ZEHNERTASTATUR) (KeyDown) +3:1213:0:49:1 //Set octave 1: 1 (KeyDown) +3:1213:0:97:1 //Set octave 1: 1 (ZEHNERTASTATUR) (KeyDown) +3:1214:0:50:1 //Set octave 2: 2 (KeyDown) +3:1214:0:98:1 //Set octave 2: 2 (ZEHNERTASTATUR) (KeyDown) +3:1215:0:51:1 //Set octave 3: 3 (KeyDown) +3:1215:0:99:1 //Set octave 3: 3 (ZEHNERTASTATUR) (KeyDown) +3:1216:0:52:1 //Set octave 4: 4 (KeyDown) +3:1216:0:100:1 //Set octave 4: 4 (ZEHNERTASTATUR) (KeyDown) +3:1217:0:53:1 //Set octave 5: 5 (KeyDown) +3:1217:0:101:1 //Set octave 5: 5 (ZEHNERTASTATUR) (KeyDown) +3:1218:0:54:1 //Set octave 6: 6 (KeyDown) +3:1218:0:102:1 //Set octave 6: 6 (ZEHNERTASTATUR) (KeyDown) +3:1219:0:55:1 //Set octave 7: 7 (KeyDown) +3:1219:0:103:1 //Set octave 7: 7 (ZEHNERTASTATUR) (KeyDown) +3:1220:0:56:1 //Set octave 8: 8 (KeyDown) +3:1220:0:104:1 //Set octave 8: 8 (ZEHNERTASTATUR) (KeyDown) +3:1221:0:57:1 //Set octave 9: 9 (KeyDown) +3:1221:0:105:1 //Set octave 9: 9 (ZEHNERTASTATUR) (KeyDown) +3:1316:1:16:1 //Chord Modifier: Shift+UMSCHALT (KeyDown) +3:1200:0:220:1 //Note cut: ZIRKUMFLEX (KeyDown) +3:1201:0:221:1 //Note off: AKUT (KeyDown) + +//----( Pattern Context [bottom] - Ins Col (4) )------------ +4:1202:0:96:1 //Set instrument digit 0: 0 (ZEHNERTASTATUR) (KeyDown) +4:1202:0:48:1 //Set instrument digit 0: 0 (KeyDown) +4:1203:0:97:1 //Set instrument digit 1: 1 (ZEHNERTASTATUR) (KeyDown) +4:1203:0:49:1 //Set instrument digit 1: 1 (KeyDown) +4:1204:0:98:1 //Set instrument digit 2: 2 (ZEHNERTASTATUR) (KeyDown) +4:1204:0:50:1 //Set instrument digit 2: 2 (KeyDown) +4:1205:0:99:1 //Set instrument digit 3: 3 (ZEHNERTASTATUR) (KeyDown) +4:1205:0:51:1 //Set instrument digit 3: 3 (KeyDown) +4:1206:0:100:1 //Set instrument digit 4: 4 (ZEHNERTASTATUR) (KeyDown) +4:1206:0:52:1 //Set instrument digit 4: 4 (KeyDown) +4:1207:0:101:1 //Set instrument digit 5: 5 (ZEHNERTASTATUR) (KeyDown) +4:1207:0:53:1 //Set instrument digit 5: 5 (KeyDown) +4:1208:0:102:1 //Set instrument digit 6: 6 (ZEHNERTASTATUR) (KeyDown) +4:1208:0:54:1 //Set instrument digit 6: 6 (KeyDown) +4:1209:0:103:1 //Set instrument digit 7: 7 (ZEHNERTASTATUR) (KeyDown) +4:1209:0:55:1 //Set instrument digit 7: 7 (KeyDown) +4:1210:0:56:1 //Set instrument digit 8: 8 (KeyDown) +4:1211:0:105:1 //Set instrument digit 9: 9 (ZEHNERTASTATUR) (KeyDown) +4:1211:0:57:1 //Set instrument digit 9: 9 (KeyDown) + +//----( Pattern Context [bottom] - Vol Col (5) )------------ +5:1222:0:48:1 //Set volume digit 0: 0 (KeyDown) +5:1222:0:96:1 //Set volume digit 0: 0 (ZEHNERTASTATUR) (KeyDown) +5:1223:0:49:1 //Set volume digit 1: 1 (KeyDown) +5:1223:0:97:1 //Set volume digit 1: 1 (ZEHNERTASTATUR) (KeyDown) +5:1224:0:50:1 //Set volume digit 2: 2 (KeyDown) +5:1224:0:98:1 //Set volume digit 2: 2 (ZEHNERTASTATUR) (KeyDown) +5:1225:0:51:1 //Set volume digit 3: 3 (KeyDown) +5:1225:0:99:1 //Set volume digit 3: 3 (ZEHNERTASTATUR) (KeyDown) +5:1226:0:52:1 //Set volume digit 4: 4 (KeyDown) +5:1226:0:100:1 //Set volume digit 4: 4 (ZEHNERTASTATUR) (KeyDown) +5:1227:0:53:1 //Set volume digit 5: 5 (KeyDown) +5:1227:0:101:1 //Set volume digit 5: 5 (ZEHNERTASTATUR) (KeyDown) +5:1228:0:54:1 //Set volume digit 6: 6 (KeyDown) +5:1228:0:102:1 //Set volume digit 6: 6 (ZEHNERTASTATUR) (KeyDown) +5:1229:0:55:1 //Set volume digit 7: 7 (KeyDown) +5:1229:0:103:1 //Set volume digit 7: 7 (ZEHNERTASTATUR) (KeyDown) +5:1230:0:56:1 //Set volume digit 8: 8 (KeyDown) +5:1231:0:57:1 //Set volume digit 9: 9 (KeyDown) +5:1231:0:105:1 //Set volume digit 9: 9 (ZEHNERTASTATUR) (KeyDown) +5:1232:0:86:1 //Vol command - volume: V (KeyDown) +5:1233:0:80:1 //Vol command - pan: P (KeyDown) +5:1234:0:67:1 //Vol command - vol slide up: C (KeyDown) +5:1235:0:68:1 //Vol command - vol slide down: D (KeyDown) +5:1236:0:65:1 //Vol command - vol fine slide up: A (KeyDown) +5:1237:0:66:1 //Vol command - vol fine slide down: B (KeyDown) +5:1238:0:85:1 //Vol command - vibrato speed: U (KeyDown) +5:1239:0:72:1 //Vol command - vibrato: H (KeyDown) +5:1240:0:76:1 //Vol command - XM pan left: L (KeyDown) +5:1241:0:82:1 //Vol command - XM pan right: R (KeyDown) +5:1242:0:71:1 //Vol command - Portamento: G (KeyDown) +5:1243:0:70:1 //Vol command - Portamento Up: F (KeyDown) +5:1244:0:69:1 //Vol command - Portamento Down: E (KeyDown) +5:1245:1:186:1 //Vol command - Velocity: Shift+\xFC (KeyDown) +5:1246:0:79:1 //Vol command - Offset: O (KeyDown) + +//----( Pattern Context [bottom] - FX Col (6) )------------ +6:1294:0:220:1 //FX midi macro slide: ZIRKUMFLEX (KeyDown) +6:1295:1:186:1 //FX pseudo-velocity (experimental): Shift+\xFC (KeyDown) + +//----( Pattern Context [bottom] - Param Col (7) )------------ +7:1247:0:48:1 //FX Param digit 0: 0 (KeyDown) +7:1247:0:96:1 //FX Param digit 0: 0 (ZEHNERTASTATUR) (KeyDown) +7:1248:0:49:1 //FX Param digit 1: 1 (KeyDown) +7:1248:0:97:1 //FX Param digit 1: 1 (ZEHNERTASTATUR) (KeyDown) +7:1249:0:50:1 //FX Param digit 2: 2 (KeyDown) +7:1249:0:98:1 //FX Param digit 2: 2 (ZEHNERTASTATUR) (KeyDown) +7:1250:0:51:1 //FX Param digit 3: 3 (KeyDown) +7:1250:0:99:1 //FX Param digit 3: 3 (ZEHNERTASTATUR) (KeyDown) +7:1251:0:52:1 //FX Param digit 4: 4 (KeyDown) +7:1251:0:100:1 //FX Param digit 4: 4 (ZEHNERTASTATUR) (KeyDown) +7:1252:0:53:1 //FX Param digit 5: 5 (KeyDown) +7:1252:0:101:1 //FX Param digit 5: 5 (ZEHNERTASTATUR) (KeyDown) +7:1253:0:54:1 //FX Param digit 6: 6 (KeyDown) +7:1253:0:102:1 //FX Param digit 6: 6 (ZEHNERTASTATUR) (KeyDown) +7:1254:0:55:1 //FX Param digit 7: 7 (KeyDown) +7:1254:0:103:1 //FX Param digit 7: 7 (ZEHNERTASTATUR) (KeyDown) +7:1255:0:56:1 //FX Param digit 8: 8 (KeyDown) +7:1255:0:104:1 //FX Param digit 8: 8 (ZEHNERTASTATUR) (KeyDown) +7:1256:0:57:1 //FX Param digit 9: 9 (KeyDown) +7:1256:0:105:1 //FX Param digit 9: 9 (ZEHNERTASTATUR) (KeyDown) +7:1257:0:65:1 //FX Param digit A: A (KeyDown) +7:1258:0:66:1 //FX Param digit B: B (KeyDown) +7:1259:0:67:1 //FX Param digit C: C (KeyDown) +7:1260:0:68:1 //FX Param digit D: D (KeyDown) +7:1261:0:69:1 //FX Param digit E: E (KeyDown) +7:1262:0:70:1 //FX Param digit F: F (KeyDown) + +//----( Sample Context [bottom] (8) )------------ +8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) +8:1383:0:8:1 //Silence sample selection: R\xDCCK (KeyDown) +8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) +8:1381:3:82:1 //Reverse sample: Shift+Ctrl+R (KeyDown) +8:1382:0:46:1 //Delete sample selection: ENTF (KeyDown) +8:1386:0:107:1 //Zoom Out: + (ZEHNERTASTATUR) (KeyDown) +8:1387:0:109:1 //Zoom In: - (ZEHNERTASTATUR) (KeyDown) + +//----( Instrument Context [bottom] (9) )------------ + +//----( Comments Context [bottom] (10) )------------ + +//----( Unknown Context (11) )------------ + +//----( Unknown Context (12) )------------ + +//----( Plugin GUI Context (13) )------------ + +//----( General Context [top] (14) )------------ + +//----( Pattern Context [top] (15) )------------ + +//----( Sample Context [top] (16) )------------ + +//----( Instrument Context [top] (17) )------------ + +//----( Comments Context [top] (18) )------------ + +//----( Unknown Context (19) )------------ Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2007-05-13 11:17:15 UTC (rev 184) @@ -656,8 +656,6 @@ } // Leave - //m_nType = MOD_TYPE_IT; Relabs.note: Moved to the beginning of loading(April 2007) - m_nMaxPeriod = 0xF000; m_nMinPeriod = 8; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2007-05-13 11:17:15 UTC (rev 184) @@ -435,7 +435,6 @@ memset(&m_SongEQ, 0, sizeof(m_SongEQ)); m_lTotalSampleCount=0; - m_nMixLevels=mixLevels_117RC3; m_pConfig = new CSoundFilePlayConfig(); BuildDefaultInstrument(); @@ -484,6 +483,7 @@ m_nMaxOrderPosition = 0; m_lpszPatternNames = NULL; m_lpszSongComments = NULL; + m_nMixLevels = mixLevels_original; // Will be overridden if appropriate. memset(Ins, 0, sizeof(Ins)); memset(ChnMix, 0, sizeof(ChnMix)); memset(Chn, 0, sizeof(Chn)); @@ -588,8 +588,10 @@ } #endif } else { + // New song m_dwCreatedWithVersion = CMainFrame::GetFullVersionNumeric(); } + // Adjust song names for (UINT iSmp=0; iSmp<MAX_SAMPLES; iSmp++) { @@ -690,7 +692,9 @@ } } } - m_pConfig->SetPluginMixLevels(m_nMixLevels); + + // Set up mix levels + m_pConfig->SetMixLevels(m_nMixLevels); RecalculateGainForAllPlugs(); if (m_nType) @@ -699,8 +703,6 @@ return TRUE; } - - return FALSE; } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/soundlib/Sndfile.h 2007-05-13 11:17:15 UTC (rev 184) @@ -819,13 +819,13 @@ double GetPlaybackTimeAt(ORDERINDEX, ROWINDEX); #ifndef TRADITIONAL_MODCOMMAND - void OnSetEffect(MODCOMMAND& mc, EFFECT_ID); //When adding a modeffect to pattern, this is to be called to //do the actual adding and this can do modifications if needed. + void OnSetEffect(MODCOMMAND& mc, EFFECT_ID); - void OnSetEffectParam(MODCOMMAND& mc, EFFECT_PARAM); //When adding a modeffect parameter to pattern, this is to be called to //do the actual adding and this can do modifications if needed. + void OnSetEffectParam(MODCOMMAND& mc, EFFECT_PARAM); #endif virtual bool GetModSpecificFlag(BYTE i) @@ -866,9 +866,6 @@ bitset<8> m_ModFlags; const CModSpecifications* m_pModSpecs; - - - public: // Static Members static UINT m_nXBassDepth, m_nXBassRange; static float m_nMaxSample; @@ -947,21 +944,15 @@ BOOL Destroy(); UINT GetType() const { return m_nType; } + //Return the number of channels in the pattern. In 1.17.02.45 //it returned the number of channels with volume != 0 - UINT GetNumChannels() const {return m_nChannels;} - - + UINT GetNumChannels() const {return m_nChannels;} + BOOL SetMasterVolume(UINT vol, BOOL bAdjustAGC=FALSE); UINT GetMasterVolume() const { return m_nMasterVolume; } UINT GetNumPatterns() const; UINT GetNumInstruments() const {return m_nInstruments;} - //Relabs.note: The above method didn't seem to work - //reasonably nor any reference to it seemed to exist. - //Replaced it so that it now really returns the - //number of instruments, not the number of samples - //within the range of maximum instrument number - UINT GetNumSamples() const { return m_nSamples; } UINT GetCurrentPos() const; UINT GetCurrentPattern() const { return m_nPattern; } @@ -969,6 +960,8 @@ UINT GetSongComments(LPSTR s, UINT cbsize, UINT linesize=32); UINT GetRawSongComments(LPSTR s, UINT cbsize, UINT linesize=32); UINT GetMaxPosition() const; + const CModSpecifications * GetModSpecifications() {return m_pModSpecs;} + double GetCurrentBPM() const; int FindOrder(PATTERNINDEX pat, UINT startFromOrder=0, bool direction=true); //rewbs.playSongFromCursor void DontLoopPattern(int nPat, int nRow=0); //rewbs.playSongFromCursor Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2007-05-12 20:04:56 UTC (rev 183) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2007-05-13 11:17:15 UTC (rev 184) @@ -21,6 +21,7 @@ uint16 modNameLengthMax; //Meaning 'usable letters', possible null character is not included. SAMPLEINDEX samplesMax; INSTRUMENTINDEX instrumentsMax; + BYTE defaultMixLevels; }; enum { @@ -53,6 +54,7 @@ 256, //Max mod name length 4000, //SamplesMax 256, //instrumentMax + mixLevels_117RC3, //defaultMixLevels }; @@ -73,6 +75,7 @@ 20, //Max mod name length 31, //SamplesMax 0, //instrumentMax + mixLevels_original, //defaultMixLevels }; @@ -91,7 +94,7 @@ 20, //Max mod name length 31, //SamplesMax 256, //instrumentMax - + mixLevels_117RC3, //defaultMixLevels }; const CModSpecifications S3M_SPECS = @@ -109,6 +112,7 @@ 27, //Max mod name length 31, //SamplesMax 0, //instrumentMax + mixLevels_original, //defaultMixLevels }; const CModSpecifications IT_SPECS = @@ -126,6 +130,7 @@ 25, //Max mod name length(in ittech.txt: "0000: \xB3'I'\xB3'M'\xB3'P'\xB3'M'\xB3 Song Name, max 26 characters, includes NULL \xB3") 256, //SamplesMax 256, //instrumentMax + mixLevels_117RC3, //defaultMixLevels }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2007-05-16 19:58:33
|
Revision: 185 http://svn.sourceforge.net/modplug/?rev=185&view=rev Author: relabsoluness Date: 2007-05-16 12:53:38 -0700 (Wed, 16 May 2007) Log Message: ----------- . <Relabs> Pitch/Tempo lock fix(broken in .46 and .47) Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2007-05-13 11:17:15 UTC (rev 184) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2007-05-16 19:53:38 UTC (rev 185) @@ -1024,7 +1024,7 @@ if (!m_bInitialized) dwHintMask |= HINT_MODTYPE; if (dwHintMask & HINT_MODTYPE) { - BOOL bITonly = ((m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; + BOOL bITandMPT = ((m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; //rewbs.instroVSTi BOOL bITandXM = (((m_pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) || (m_pSndFile->m_nType == MOD_TYPE_XM)) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; bool bMPTOnly = ((m_pSndFile->m_nType == MOD_TYPE_MPT) && (m_pSndFile->m_nInstruments)) ? TRUE : FALSE; @@ -1034,7 +1034,7 @@ ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT2), bITandXM); m_SliderAttack.EnableWindow(bITandXM); m_EditName.EnableWindow(bITandXM); - m_EditFileName.EnableWindow(bITonly); + m_EditFileName.EnableWindow(bITandMPT); m_CbnMidiCh.EnableWindow(bITandXM); m_CbnMixPlug.EnableWindow(bITandXM); m_SpinMidiPR.EnableWindow(bITandXM); @@ -1044,32 +1044,32 @@ m_NoteMap.EnableWindow(bITandXM); m_CbnResampling.EnableWindow(bITandXM); - m_ComboNNA.EnableWindow(bITonly); - m_SliderVolSwing.EnableWindow(bITonly); - m_SliderPanSwing.EnableWindow(bITonly); - m_SliderCutSwing.EnableWindow(bITonly); - m_SliderResSwing.EnableWindow(bITonly); - m_CbnFilterMode.EnableWindow(bITonly); - m_ComboDCT.EnableWindow(bITonly); - m_ComboDCA.EnableWindow(bITonly); - m_ComboPPC.EnableWindow(bITonly); - m_SpinPPS.EnableWindow(bITonly); - m_EditGlobalVol.EnableWindow(bITonly); - m_SpinGlobalVol.EnableWindow(bITonly); - m_EditPanning.EnableWindow(bITonly); - m_SpinPanning.EnableWindow(bITonly); - m_CheckPanning.EnableWindow(bITonly); - m_EditPPS.EnableWindow(bITonly); - m_CheckCutOff.EnableWindow(bITonly); - m_CheckResonance.EnableWindow(bITonly); - m_CheckHighpass.EnableWindow(bITonly); - m_SliderCutOff.EnableWindow(bITonly); - m_SliderResonance.EnableWindow(bITonly); + m_ComboNNA.EnableWindow(bITandMPT); + m_SliderVolSwing.EnableWindow(bITandMPT); + m_SliderPanSwing.EnableWindow(bITandMPT); + m_SliderCutSwing.EnableWindow(bITandMPT); + m_SliderResSwing.EnableWindow(bITandMPT); + m_CbnFilterMode.EnableWindow(bITandMPT); + m_ComboDCT.EnableWindow(bITandMPT); + m_ComboDCA.EnableWindow(bITandMPT); + m_ComboPPC.EnableWindow(bITandMPT); + m_SpinPPS.EnableWindow(bITandMPT); + m_EditGlobalVol.EnableWindow(bITandMPT); + m_SpinGlobalVol.EnableWindow(bITandMPT); + m_EditPanning.EnableWindow(bITandMPT); + m_SpinPanning.EnableWindow(bITandMPT); + m_CheckPanning.EnableWindow(bITandMPT); + m_EditPPS.EnableWindow(bITandMPT); + m_CheckCutOff.EnableWindow(bITandMPT); + m_CheckResonance.EnableWindow(bITandMPT); + m_CheckHighpass.EnableWindow(bITandMPT); + m_SliderCutOff.EnableWindow(bITandMPT); + m_SliderResonance.EnableWindow(bITandMPT); m_SpinInstrument.SetRange(1, m_pSndFile->m_nInstruments); m_SpinInstrument.EnableWindow((m_pSndFile->m_nInstruments) ? TRUE : FALSE); m_ComboTuning.EnableWindow(bMPTOnly); - m_EditPitchTempoLock.EnableWindow(bMPTOnly); - m_CheckPitchTempoLock.EnableWindow(bMPTOnly); + m_EditPitchTempoLock.EnableWindow(bITandMPT); + m_CheckPitchTempoLock.EnableWindow(bITandMPT); } if (dwHintMask & (HINT_INSTRUMENT|HINT_MODTYPE)) { Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2007-05-13 11:17:15 UTC (rev 184) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2007-05-16 19:53:38 UTC (rev 185) @@ -1420,12 +1420,12 @@ { freq = GetFreqFromPeriod(period, pChn->nC4Speed, nPeriodFrac); } - else //In this case: m_nType == MOD_TYPE_MPT + else //In this case: m_nType == MOD_TYPE_MPT and using custom tunings. { m_nRow; if(pChn->m_CalculateFreq || (pChn->m_ReCalculateFreqOnFirstTick && m_nTickCount == 0)) { - pChn->m_Freq = static_cast<UINT>(pChn->nC4Speed * vibratoFactor * pChn->pHeader->pTuning->GetFrequencyRatio(pChn->nNote - NOTE_MIDDLEC + arpeggioSteps, static_cast<CTuning::FINESTEPTYPE>(pChn->nFineTune)+pChn->m_PortamentoFineSteps)); + pChn->m_Freq = pChn->nC4Speed * vibratoFactor * pChn->pHeader->pTuning->GetFrequencyRatio(pChn->nNote - NOTE_MIDDLEC + arpeggioSteps, static_cast<CTuning::FINESTEPTYPE>(pChn->nFineTune)+pChn->m_PortamentoFineSteps); if(!pChn->m_CalculateFreq) pChn->m_ReCalculateFreqOnFirstTick = false; else @@ -1433,17 +1433,13 @@ } freq = pChn->m_Freq; - - //Doing instrument specific things. - if(pChn->pHeader) - { - //Pitch/Tempo lock (yet another feature from MPT23 :) - if(pChn->pHeader->wPitchToTempoLock) - freq *= static_cast<UINT>((float)m_nMusicTempo / (float)pChn->pHeader->wPitchToTempoLock); - } } + //Applying Pitch/Tempo lock. + if(m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT) && pChn->pHeader && pChn->pHeader->wPitchToTempoLock) + freq *= (float)m_nMusicTempo / (float)pChn->pHeader->wPitchToTempoLock; + if ((m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (freq < 256)) { pChn->nFadeOutVol = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <re...@us...> - 2007-05-27 17:47:43
|
Revision: 188 http://svn.sourceforge.net/modplug/?rev=188&view=rev Author: rewbs Date: 2007-05-27 10:47:34 -0700 (Sun, 27 May 2007) Log Message: ----------- v1.17.02.48 . <Relabs> Fix song cleanup issue (http://lpchip.com/modplug/viewtopic.php?t=1711) . <Relabs> Pitch/Tempo lock fix (broken in .46 and .47) (http://lpchip.com/modplug/viewtopic.php?t=1646) / <Relabs> Pattern manager channel reordering behviour changes / fixes. (http://lpchip.com/modplug/viewtopic.php?t=1148) . <pelya> Fix bad horizontal scrolling in pattern editor when positioning the cursor with the mouse. (http://lpchip.com/modplug/viewtopic.php?t=1650) . <rewbs> Fix odd "play row" behaviour when using 1 tick-per-row (http://lpchip.com/modplug/viewtopic.php?t=1038). . <rewbs> Fix pop due to ramping when song starts with a pattern command that sets a low global volume. (http://lpchip.com/modplug/viewtopic.php?t=523) . <rewbs> Fix occasional colour issues with orderlist (http://lpchip.com/modplug/viewtopic.php?t=867) . <rewbs> Fix impossible horizontal scrolling in pattern editor when playing with follow song on . <rewbs> Grey out "Trim" option in sample editor context menu if there's no selection. (http://lpchip.com/modplug/viewtopic.php?t=908) Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_pat.h trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/bin/mptrack.exe trunk/OpenMPT/mptrack/bin/version trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/default.mkb trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_pat.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.h 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/mptrack/Ctrl_pat.h 2007-05-27 17:47:34 UTC (rev 188) @@ -11,12 +11,12 @@ protected: HFONT m_hFont; COLORREF colorText, colorTextSel; - int m_cxFont, m_cyFont, m_nXScroll, m_nScrollPos, m_nDropPos; //m_nXScroll : The order at the beginning of shown orderlist? //m_nScrollPos: The same as order? - BYTE m_nOrderlistMargins; + int m_cxFont, m_cyFont, m_nXScroll, m_nScrollPos, m_nDropPos; //To tell how many orders('orderboxes') to show at least //on both sides of current order(when updating orderslist position). + BYTE m_nOrderlistMargins; UINT m_nDragOrder; BOOL m_bScrolling, m_bDragging, m_bShift; CModDoc *m_pModDoc; Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2007-05-27 17:47:34 UTC (rev 188) @@ -467,8 +467,13 @@ int nOrder = ((nIndex >= 0) && (nIndex < pSndFile->Order.size())) ? pSndFile->Order[nIndex] : -1; if ((rect.right = rect.left + m_cxFont) > rcClient.right) rect.right = rcClient.right; rect.right--; - FillRect(dc.m_hDC, &rect, (bHighLight) ? CMainFrame::brushHighLight : CMainFrame::brushWindow); + if (bHighLight) { + FillRect(dc.m_hDC, &rect, CMainFrame::brushHighLight); + } else { + FillRect(dc.m_hDC, &rect, CMainFrame::brushWindow); + } + //Drawing the shown pattern-indicator or drag position. if (nIndex == ((m_bDragging) ? (int)m_nDropPos : m_nScrollPos)) { Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2007-05-27 17:47:34 UTC (rev 188) @@ -1006,8 +1006,9 @@ HWND hWnd = ::GetFocus(); if (hWnd != NULL) { - TCHAR szClassName[512]; - textboxHasFocus = GetClassName(hWnd, szClassName, 6) && _tcsicmp(szClassName, _T("Edit")) == 0; + TCHAR activeWindowClassName[512]; + GetClassName(hWnd, activeWindowClassName, 6); + textboxHasFocus = _tcsicmp(activeWindowClassName, _T("Edit")) == 0; if (textboxHasFocus) { handledByTextBox = m_InputHandler->isKeyPressHandledByTextBox(wParam); } @@ -1752,7 +1753,7 @@ COLORREF crBkgnd = GetSysColor(COLOR_WINDOW); if (brushHighLight) DeleteObject(brushHighLight); brushHighLight = CreateSolidBrush(GetSysColor(COLOR_HIGHLIGHT)); - if (brushHighLightRed) DeleteObject(brushHighLight); + if (brushHighLightRed) DeleteObject(brushHighLightRed); brushHighLightRed = CreateSolidBrush(RGB(0xFF,0x00,0x00)); if (brushWindow) DeleteObject(brushWindow); Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2007-05-27 17:47:34 UTC (rev 188) @@ -1573,10 +1573,9 @@ SetDlgItemText(IDC_EDIT3, CString("Open Modplug Tracker, version ") + CMainFrame::GetFullVersionString()); m_heContact.SetWindowText( -"Contact:\r\n\ -MPC forums: http://lpchip.com/modplug/\r\n\ -Robin Fernandes: mailto:mo...@so...\r\n\r\n\ -Updates:\r\n\ +"Contact / Discussion:\r\n\ +http://modplug.sourceforge.net/forum\r\n\ +\r\n\Updates:\r\n\ http://modplug.sourceforge.net/builds/#dev"); char *pArrCredit = { Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2007-05-27 17:47:34 UTC (rev 188) @@ -222,9 +222,22 @@ } -BOOL CViewPattern::SetCurrentRow(UINT row, BOOL bWrap) -//---------------------------------------------------- +// This should be used instead of consecutive calls to SetCurrentRow() then SetCurrentColumn() +BOOL CViewPattern::SetCursorPosition(UINT nrow, UINT ncol, BOOL bWrap) +//-------------------------------------------------------------------------- { + // Set row, but do not update scroll position yet + // as there is another position update on the way: + SetCurrentRow(nrow, bWrap, false); + // Now set column and update scroll position: + SetCurrentColumn(ncol); + return TRUE; +} + + +BOOL CViewPattern::SetCurrentRow(UINT row, BOOL bWrap, BOOL bUpdateHorizontalScrollbar) +//------------------------------------------------------------------------------------- +{ CSoundFile *pSndFile; CModDoc *pModDoc = GetDocument(); if (!pModDoc) return FALSE; @@ -296,7 +309,8 @@ // Fix: If cursor isn't on screen move both scrollbars to make it visible InvalidateRow(); m_nRow = row; - UpdateScrollbarPositions(); //UpdateScrollbarPositions( false ); // default behavior is to move only vertical scrollbar + // Fix: Horizontal scrollbar pos screwed when selecting with mouse + UpdateScrollbarPositions(bUpdateHorizontalScrollbar); InvalidateRow(); int sel = m_dwCursor | (m_nRow << 16); int sel0 = sel; @@ -350,7 +364,7 @@ // Assume that m_nRow and m_dwCursor are valid // When we switching to other tab the CViewPattern object is deleted // and when switching back new one is created -BOOL CViewPattern::UpdateScrollbarPositions( bool UpdateHorizontalScrollbar ) +BOOL CViewPattern::UpdateScrollbarPositions( BOOL UpdateHorizontalScrollbar ) { // HACK - after new CViewPattern object created SetCurrentRow() and SetCurrentColumn() are called - // just skip first two calls of UpdateScrollbarPositions() if pModDoc->GetOldPatternScrollbarsPos() is valid @@ -1012,8 +1026,8 @@ SetCurSel(m_dwStartSel, m_dwStartSel); } else { - SetCurrentRow(m_dwStartSel >> 16); - SetCurrentColumn(m_dwStartSel & 0xFFFF); + // Fix: Horizontal scrollbar pos screwed when selecting with mouse + SetCursorPosition( m_dwStartSel >> 16, m_dwStartSel & 0xFFFF ); } } } @@ -1071,8 +1085,8 @@ if ((m_nMidRow) && (m_dwBeginSel == m_dwEndSel)) { DWORD dwPos = m_dwBeginSel; - SetCurrentRow(dwPos >> 16); - SetCurrentColumn(dwPos & 0xFFFF); + // Fix: Horizontal scrollbar pos screwed when selecting with mouse + SetCursorPosition( dwPos >> 16, dwPos & 0xFFFF ); //UpdateIndicator(); } } @@ -1165,8 +1179,8 @@ || ((m_nMenuParam & 0xFFFF) > (m_dwEndSel & 0xFFFF))) { if (pt.y > m_szHeader.cy) { //ensure we're not clicking header - SetCurrentRow(m_nMenuParam >> 16); - SetCurrentColumn(m_nMenuParam & 0xFFFF); + // Fix: Horizontal scrollbar pos screwed when selecting with mouse + SetCursorPosition( m_nMenuParam >> 16, m_nMenuParam & 0xFFFF ); } } UINT nChn = (m_nMenuParam & 0xFFFF) >> 3; @@ -1299,8 +1313,8 @@ DragToSel(dwPos, TRUE); } else { - SetCurrentRow(dwPos >> 16); - SetCurrentColumn(dwPos & 0xFFFF); + // Fix: Horizontal scrollbar pos screwed when selecting with mouse + SetCursorPosition( dwPos >> 16, dwPos & 0xFFFF ); } } } @@ -1514,8 +1528,8 @@ //rewbs.customKeys DWORD finalPos = (min(m_dwEndSel >> 16, m_dwBeginSel >> 16) << 16 | (m_dwEndSel & 0xFFFF)); SetCurSel(finalPos, finalPos); - SetCurrentColumn(finalPos & 0xFFFF); - SetCurrentRow(finalPos >> 16); + // Fix: Horizontal scrollbar pos screwed when selecting with mouse + SetCursorPosition( finalPos >> 16, finalPos & 0xFFFF ); //end rewbs.customKeys pModDoc->SetModified(); @@ -2347,8 +2361,8 @@ if (y2<0) y2=0; if (y2>=nRows) y2=nRows-1; if (c2 >= 3) c2 = 4; - SetCurrentRow(y1); - SetCurrentColumn((x1<<3)|c1); + // Fix: Horizontal scrollbar pos screwed when selecting with mouse + SetCursorPosition( y1, (x1<<3)|c1 ); SetCurSel((y1<<16)|(x1<<3)|c1, (y2<<16)|(x2<<3)|c2); InvalidatePattern(); CSoundFile::FreePattern(pOldPattern); @@ -2769,7 +2783,7 @@ if (nOrd < pSndFile->Order.size()) SendCtrlMessage(CTRLMSG_SETCURRENTORDER, nOrd); updateOrderList = false; } - if (nRow != m_nRow) SetCurrentRow((nRow < pSndFile->PatternSize[nPat]) ? nRow : 0); + if (nRow != m_nRow) SetCurrentRow((nRow < pSndFile->PatternSize[nPat]) ? nRow : 0, FALSE, FALSE); } SetPlayCursor(0xFFFF, 0); } else @@ -3064,8 +3078,8 @@ if (/*(pState->nPattern == m_nPattern) && */(pState->cbStruct == sizeof(PATTERNVIEWSTATE))) { SetCurrentPattern(pState->nPattern); - SetCurrentRow(pState->nRow); - SetCurrentColumn(pState->nCursor); + // Fix: Horizontal scrollbar pos screwed when selecting with mouse + SetCursorPosition( pState->nRow, pState->nCursor ); SetCurSel(pState->dwBeginSel, pState->dwEndSel); } } @@ -4917,3 +4931,4 @@ + Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/mptrack/View_pat.h 2007-05-27 17:47:34 UTC (rev 188) @@ -73,18 +73,8 @@ CPatternGotoDialog *m_pGotoWnd; SIZE m_szHeader, m_szCell; UINT m_nPattern, m_nRow, m_nMidRow, m_nPlayPat, m_nPlayRow, m_nSpacing, m_nAccelChar, m_nLastPlayedRow, m_nLastPlayedOrder; - -// -> CODE#0012 -// -> DESC="midi keyboard split" -// UINT CViewPattern::GetCurrentSplitInstrument() const; -// UINT CViewPattern::GetCurrentSplitNote() const; -// UINT CViewPattern::GetCurrentOctaveModifier() const; -// UINT CViewPattern::GetCurrentOctaveLink() const; -// UINT CViewPattern::GetCurrentSplitVolume() const; -// rewbs.merge: inverted message direction UINT m_nSplitInstrument, m_nSplitNote, m_nOctaveModifier, m_nSplitVolume; BOOL m_bOctaveLink; -// -! NEW_FEATURE#0012 int m_nXScroll, m_nYScroll; DWORD m_nDragItem, m_nMenuParam, m_nDetailLevel; @@ -149,12 +139,13 @@ void InvalidateChannelsHeaders(); void SetCurSel(DWORD dwBegin, DWORD dwEnd); BOOL SetCurrentPattern(UINT npat, int nrow=-1); - BOOL SetCurrentRow(UINT nrow, BOOL bWrap=FALSE); + BOOL SetCurrentRow(UINT nrow, BOOL bWrap=FALSE, BOOL bUpdateHorizontalScrollbar=TRUE ); BOOL SetCurrentColumn(UINT ncol); + // This should be used instead of consecutive calls to SetCurrentRow() then SetCurrentColumn() + BOOL SetCursorPosition(UINT nrow, UINT ncol, BOOL bWrap=FALSE ); BOOL DragToSel(DWORD dwPos, BOOL bScroll, BOOL bNoMove=FALSE); BOOL SetPlayCursor(UINT nPat, UINT nRow); -// Fix: If cursor isn't on screen move scrollbars to make it visible - BOOL UpdateScrollbarPositions( bool UpdateHorizontalScrollbar=true ); + BOOL UpdateScrollbarPositions( BOOL bUpdateHorizontalScrollbar=TRUE ); // -> CODE#0014 // -> DESC="vst wet/dry slider" // BOOL EnterNote(UINT nNote, UINT nIns=0, BOOL bCheck=FALSE, int vol=-1, BOOL bMultiCh=FALSE); @@ -354,3 +345,4 @@ #endif + Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2007-05-27 17:47:34 UTC (rev 188) @@ -1321,7 +1321,8 @@ if (pins->uFlags & CHN_STEREO) ::AppendMenu(hMenu, MF_STRING, ID_SAMPLE_MONOCONVERT, "Convert to mono"); } - ::AppendMenu(hMenu, MF_STRING, ID_SAMPLE_TRIM, "Trim\t" + ih->GetKeyTextFromCommand(kcSampleTrim)); + ::AppendMenu(hMenu, MF_STRING|(m_dwEndSel>m_dwBeginSel)?0:MF_GRAYED, + ID_SAMPLE_TRIM, "Trim\t" + ih->GetKeyTextFromCommand(kcSampleTrim)); ::AppendMenu(hMenu, MF_STRING, ID_EDIT_CUT, "Cut\t" + ih->GetKeyTextFromCommand(kcEditCut)); ::AppendMenu(hMenu, MF_STRING, ID_EDIT_COPY, "Copy\t" + ih->GetKeyTextFromCommand(kcEditCopy)); } Modified: trunk/OpenMPT/mptrack/bin/mptrack.exe =================================================================== (Binary files differ) Modified: trunk/OpenMPT/mptrack/bin/version =================================================================== --- trunk/OpenMPT/mptrack/bin/version 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/mptrack/bin/version 2007-05-27 17:47:34 UTC (rev 188) @@ -1 +1 @@ -1.17.02.47 \ No newline at end of file +1.17.02.48 \ No newline at end of file Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/mptrack/mptrack.rc 2007-05-27 17:47:34 UTC (rev 188) @@ -1926,7 +1926,7 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,17,2,47 + FILEVERSION 1,17,2,48 PRODUCTVERSION 0,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG @@ -1944,7 +1944,7 @@ BEGIN VALUE "CompanyName", "Olivier Lapicque / OpenMPT team" VALUE "FileDescription", "OpenMPT / ModPlug Tracker" - VALUE "FileVersion", "1, 17, 2, 47" + VALUE "FileVersion", "1, 17, 2, 48" VALUE "InternalName", "Modplug Tracker" VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2007 GPL." VALUE "LegalTrademarks", "M.O.D.P.L.U.G" Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/packageTemplate/History.txt 2007-05-27 17:47:34 UTC (rev 188) @@ -6,8 +6,19 @@ -: known issue / regression /: change ?: other -(tx XYZ): thanks to XYZ for telling me about the bug +(tx XYZ): thanks to XYZ for telling us about the bug +v1.17.02.48 + . <Relabs> Fix song cleanup issue (http://lpchip.com/modplug/viewtopic.php?t=1711) + . <Relabs> Pitch/Tempo lock fix (broken in .46 and .47) (http://lpchip.com/modplug/viewtopic.php?t=1646) + / <Relabs> Pattern manager channel reordering behviour changes / fixes. (http://lpchip.com/modplug/viewtopic.php?t=1148) + . <pelya> Fix bad horizontal scrolling in pattern editor when positioning the cursor with the mouse. (http://lpchip.com/modplug/viewtopic.php?t=1650) + . <rewbs> Fix odd "play row" behaviour when using 1 tick-per-row (http://lpchip.com/modplug/viewtopic.php?t=1038). + . <rewbs> Fix pop due to ramping when song starts with a pattern command that sets a low global volume. (http://lpchip.com/modplug/viewtopic.php?t=523) + . <rewbs> Fix occasional colour issues with orderlist (http://lpchip.com/modplug/viewtopic.php?t=867) + . <rewbs> Fix impossible horizontal scrolling in pattern editor when playing with follow song on + . <rewbs> Grey out "Trim" option in sample editor context menu if there's no selection. (http://lpchip.com/modplug/viewtopic.php?t=908) + v1.17.02.47 ? <rewbs> An update checker was introduced in the previous version. If you had any problems with the update notification, please report a bug. . <pelya> Save pattern scrollbar position when switching to other tabs Modified: trunk/OpenMPT/packageTemplate/default.mkb =================================================================== --- trunk/OpenMPT/packageTemplate/default.mkb 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/packageTemplate/default.mkb 2007-05-27 17:47:34 UTC (rev 188) @@ -1,4 +1,4 @@ -//-------- Modplug Tracker key binding definition file ------- +//-------- OpenMPT key binding definition file ------- //-Format is: - //- Context:Command ID:Modifiers:Key:KeypressEventType //Comments - //---------------------------------------------------------------------- @@ -9,7 +9,7 @@ 0:1349:2:83:1 //File/Save: Ctrl+S (KeyDown) 0:1030:0:116:1 //Play song/Pause song: F5 (KeyDown) 0:1031:0:119:1 //Pause song: F8 (KeyDown) -0:1375:0:27:1 //Stop Song: Esc (KeyDown) +0:1375:0:27:1 //Stop Song: ESC (KeyDown) 0:1029:0:117:1 //Play song from start: F6 (KeyDown) 0:1027:0:118:5 //Play pattern from start: F7 (KeyDown|KeyHold) 0:1026:2:118:5 //Play pattern from cursor: Ctrl+F7 (KeyDown|KeyHold) @@ -17,9 +17,9 @@ 0:1359:2:90:1 //Undo: Ctrl+Z (KeyDown) 0:1360:2:88:1 //Cut: Ctrl+X (KeyDown) 0:1361:2:67:1 //Copy: Ctrl+C (KeyDown) -0:1361:2:45:1 //Copy: Ctrl+Ins (KeyDown) +0:1361:2:45:1 //Copy: Ctrl+INSERT (KeyDown) 0:1362:2:86:1 //Paste: Ctrl+V (KeyDown) -0:1362:1:45:1 //Paste: Shift+Ins (KeyDown) +0:1362:1:45:1 //Paste: Shift+INSERT (KeyDown) 0:1364:2:53:1 //SelectAll: Ctrl+5 (KeyDown) 0:1365:2:70:1 //Find: Ctrl+F (KeyDown) 0:1366:0:114:1 //Find Next: F3 (KeyDown) @@ -31,45 +31,52 @@ 0:1368:2:113:1 //Toggle Tree View: Ctrl+F2 (KeyDown) 0:1369:2:112:1 //View Options: Ctrl+F1 (KeyDown) 0:1370:0:112:1 //Help (to do): F1 (KeyDown) -0:1032:2:111:5 //Previous instrument: Ctrl+ (KeyDown|KeyHold) -0:1032:2:38:5 //Previous instrument: Ctrl+Up (KeyDown|KeyHold) -0:1033:2:106:5 //Next instrument: Ctrl+Num * (KeyDown|KeyHold) -0:1033:2:40:5 //Next instrument: Ctrl+Down (KeyDown|KeyHold) -0:1036:0:111:1 //Previous octave: (KeyDown) -0:1037:0:106:1 //Next octave: Num * (KeyDown) -0:1034:2:37:5 //Previous order: Ctrl+Left (KeyDown|KeyHold) -0:1035:2:39:5 //Next order: Ctrl+Right (KeyDown|KeyHold) +0:1032:2:111:5 //Previous instrument: Ctrl+NUM DIVIDE (KeyDown|KeyHold) +0:1032:2:38:5 //Previous instrument: Ctrl+UP (KeyDown|KeyHold) +0:1033:2:106:5 //Next instrument: Ctrl+NUMMULT (KeyDown|KeyHold) +0:1033:2:40:5 //Next instrument: Ctrl+DOWN (KeyDown|KeyHold) +0:1036:0:111:1 //Previous octave: NUM DIVIDE (KeyDown) +0:1037:0:106:1 //Next octave: NUMMULT (KeyDown) +0:1034:2:37:5 //Previous order: Ctrl+LEFT (KeyDown|KeyHold) +0:1035:2:39:5 //Next order: Ctrl+RIGHT (KeyDown|KeyHold) //----( General Context [bottom] (1) )------------ //----( Pattern Context [bottom] (2) )------------ -2:1017:0:34:1 //Jump down by highlight1: Page Down (KeyDown) -2:1018:0:33:1 //Jump up by highlight1: Page Up (KeyDown) -2:1338:4:34:1 //Jump down by highlight2: Alt+Page Down (KeyDown) -2:1339:4:33:1 //Jump up by highlight2: Alt+Page Up (KeyDown) -2:1340:6:34:5 //Snap down to highlight2: Ctrl+Alt+Page Down (KeyDown|KeyHold) -2:1341:6:33:5 //Snap up to highlight2: Ctrl+Alt+Page Up (KeyDown|KeyHold) -2:1038:0:40:5 //Navigate down: Down (KeyDown|KeyHold) -2:1039:0:38:1 //Navigate up: Up (KeyDown) -2:1040:0:37:5 //Navigate left: Left (KeyDown|KeyHold) -2:1041:0:39:5 //Navigate right: Right (KeyDown|KeyHold) -2:1042:0:9:1 //Navigate to next channel: Tab (KeyDown) -2:1043:1:9:1 //Navigate to previous channel: Shift+Tab (KeyDown) -2:1044:0:36:1 //Go to first channel: Home (KeyDown) -2:1045:2:36:1 //Go to first row: Ctrl+Home (KeyDown) -2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+Home (KeyDown) -2:1047:0:35:1 //Go to last channel: End (KeyDown) -2:1048:2:35:1 //Go to last row: Ctrl+End (KeyDown) -2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+End (KeyDown) +2:1017:0:34:5 //Jump down by measure: PGDOWN (KeyDown|KeyHold) +2:1018:0:33:5 //Jump up by measure: PGUP (KeyDown|KeyHold) +2:1338:4:34:5 //Jump down by beat: Alt+PGDOWN (KeyDown|KeyHold) +2:1339:4:33:5 //Jump up by beat: Alt+PGUP (KeyDown|KeyHold) +2:1340:6:34:5 //Snap down to beat: Ctrl+Alt+PGDOWN (KeyDown|KeyHold) +2:1341:6:33:5 //Snap up to beat: Ctrl+Alt+PGUP (KeyDown|KeyHold) +2:1038:0:40:5 //Navigate down by 1 row: DOWN (KeyDown|KeyHold) +2:1039:0:38:5 //Navigate up by 1 row: UP (KeyDown|KeyHold) +2:1691:4:40:5 //Navigate down by spacing: Alt+DOWN (KeyDown|KeyHold) +2:1692:4:38:5 //Navigate up by spacing: Alt+UP (KeyDown|KeyHold) +2:1040:0:37:5 //Navigate left: LEFT (KeyDown|KeyHold) +2:1041:0:39:5 //Navigate right: RIGHT (KeyDown|KeyHold) +2:1042:0:9:5 //Navigate to next channel: TAB (KeyDown|KeyHold) +2:1043:1:9:5 //Navigate to previous channel: Shift+TAB (KeyDown|KeyHold) +2:1044:0:36:1 //Go to first channel: HOME (KeyDown) +2:1045:2:36:1 //Go to first row: Ctrl+HOME (KeyDown) +2:1046:6:36:1 //Go to first row of first channel: Ctrl+Alt+HOME (KeyDown) +2:1047:0:35:1 //Go to last channel: END (KeyDown) +2:1048:2:35:1 //Go to last row: Ctrl+END (KeyDown) +2:1049:6:35:1 //Go to last row of last channel: Ctrl+Alt+END (KeyDown) +2:1050:1:16:1 //Selection key: Shift (KeyDown) +2:1051:2:17:1 //Copy select key: Ctrl (KeyDown) 2:1011:2:76:1 //Select channel / Select all: Ctrl+L (KeyDown) -2:1003:0:13:1 //Quick copy: Enter (KeyDown) -2:1004:0:32:5 //Quick paste: Space (KeyDown|KeyHold) -2:1001:2:32:1 //Enable recording: Ctrl+Space (KeyDown) -2:1002:2:13:5 //Play row: Ctrl+Enter (KeyDown|KeyHold) -2:1317:4:18:1 //Set row jump on note entry: Alt+Alt (KeyDown) -2:1685:2:9:1 //Switch to order list: Ctrl+Tab (KeyDown) +2:1663:0:122:1 //Toggle follow song: F11 (KeyDown) +2:1003:0:13:5 //Quick copy: ENTER (KeyDown|KeyHold) +2:1004:0:32:5 //Quick paste: SPACE (KeyDown|KeyHold) +2:1001:2:32:1 //Enable recording: Ctrl+SPACE (KeyDown) +2:1002:2:13:5 //Play row: Ctrl+ENTER (KeyDown|KeyHold) +2:1317:4:18:1 //Set row jump on note entry: Alt (KeyDown) +2:1685:2:9:1 //Switch to order list: Ctrl+TAB (KeyDown) 2:1662:6:80:1 //Toggle channel's plugin editor: Ctrl+Alt+P (KeyDown) 2:1062:0:93:1 //Show note properties: Application (KeyDown) +2:1005:0:121:5 //Mute current channel: F10 (KeyDown|KeyHold) +2:1006:2:121:5 //Solo current channel: Ctrl+F10 (KeyDown|KeyHold) 2:1007:2:81:5 //Transpose +1: Ctrl+Q (KeyDown|KeyHold) 2:1008:2:65:5 //Transpose -1: Ctrl+A (KeyDown|KeyHold) 2:1009:3:81:5 //Transpose +12: Shift+Ctrl+Q (KeyDown|KeyHold) @@ -78,19 +85,20 @@ 2:1014:2:74:1 //Interpolate volume: Ctrl+J (KeyDown) 2:1015:2:75:1 //Interpolate effect: Ctrl+K (KeyDown) 2:1016:4:66:1 //Open effect visualizer: Alt+B (KeyDown) +2:1766:2:71:1 //Go to row/channel/...: Ctrl+G (KeyDown) 2:1013:2:73:1 //Apply current instrument: Ctrl+I (KeyDown) 2:1660:4:69:5 //Grow selection: Alt+E (KeyDown|KeyHold) 2:1661:4:68:5 //Shrink selection: Alt+D (KeyDown|KeyHold) -2:1058:0:46:1 //Clear field: Del (KeyDown) +2:1058:0:46:1 //Clear field: DELETE (KeyDown) 2:1664:1:190:1 //Clear field (IT Style): Shift+. (KeyDown) -2:1059:2:46:1 //Clear row and step: Ctrl+Del (KeyDown) -2:1665:1:46:5 //Clear field and step (IT Style): Shift+Del (KeyDown|KeyHold) -2:1061:0:8:5 //Delete rows: Backspace (KeyDown|KeyHold) -2:1377:2:8:5 //Delete all rows: Ctrl+Backspace (KeyDown|KeyHold) -2:1378:0:45:1 //Insert Row: Ins (KeyDown) -2:1379:2:45:1 //Insert All Rows: Ctrl+Ins (KeyDown) -2:1055:0:109:5 //Previous pattern: Num - (KeyDown|KeyHold) -2:1054:0:107:5 //Next pattern: Num + (KeyDown|KeyHold) +2:1059:2:46:1 //Clear row and step: Ctrl+DELETE (KeyDown) +2:1665:1:46:5 //Clear field and step (IT Style): Shift+DELETE (KeyDown|KeyHold) +2:1061:0:8:5 //Delete rows: BACKSPACE (KeyDown|KeyHold) +2:1377:2:8:5 //Delete all rows: Ctrl+BACKSPACE (KeyDown|KeyHold) +2:1378:0:45:1 //Insert Row: INSERT (KeyDown) +2:1379:2:45:1 //Insert All Rows: Ctrl+INSERT (KeyDown) +2:1055:0:109:5 //Previous pattern: NUM SUB (KeyDown|KeyHold) +2:1054:0:107:5 //Next pattern: NUM PLUS (KeyDown|KeyHold) //----( Pattern Context [bottom] - Note Col (3) )------------ 3:1064:0:81:1 //Base octave C: Q (KeyDown) @@ -115,7 +123,7 @@ 3:1083:0:75:1 //Base octave +1 G: K (KeyDown) 3:1084:0:76:1 //Base octave +1 G#: L (KeyDown) 3:1085:0:186:1 //Base octave +2 A: ; (KeyDown) -3:1086:0:222:1 //Base octave +2 A#: ' (KeyDown) +3:1086:0:222:1 //Base octave +2 A#: # (KeyDown) 3:1087:0:220:1 //Base octave +2 B: \ (KeyDown) 3:1088:0:90:1 //Base octave +2 C: Z (KeyDown) 3:1089:0:88:1 //Base octave +2 C#: X (KeyDown) @@ -128,70 +136,70 @@ 3:1096:0:190:1 //Base octave +2 G#: . (KeyDown) 3:1097:0:191:1 //Base octave +3 A: / (KeyDown) 3:1212:0:48:1 //Set octave 0: 0 (KeyDown) -3:1212:0:96:1 //Set octave 0: Num 0 (KeyDown) +3:1212:0:96:1 //Set octave 0: NUM 0 (KeyDown) 3:1213:0:49:1 //Set octave 1: 1 (KeyDown) -3:1213:0:97:1 //Set octave 1: Num 1 (KeyDown) +3:1213:0:97:1 //Set octave 1: NUM 1 (KeyDown) 3:1214:0:50:1 //Set octave 2: 2 (KeyDown) -3:1214:0:98:1 //Set octave 2: Num 2 (KeyDown) +3:1214:0:98:1 //Set octave 2: NUM 2 (KeyDown) 3:1215:0:51:1 //Set octave 3: 3 (KeyDown) -3:1215:0:99:1 //Set octave 3: Num 3 (KeyDown) +3:1215:0:99:1 //Set octave 3: NUM 3 (KeyDown) 3:1216:0:52:1 //Set octave 4: 4 (KeyDown) -3:1216:0:100:1 //Set octave 4: Num 4 (KeyDown) +3:1216:0:100:1 //Set octave 4: NUM 4 (KeyDown) 3:1217:0:53:1 //Set octave 5: 5 (KeyDown) -3:1217:0:101:1 //Set octave 5: Num 5 (KeyDown) +3:1217:0:101:1 //Set octave 5: NUM 5 (KeyDown) 3:1218:0:54:1 //Set octave 6: 6 (KeyDown) -3:1218:0:102:1 //Set octave 6: Num 6 (KeyDown) +3:1218:0:102:1 //Set octave 6: NUM 6 (KeyDown) 3:1219:0:55:1 //Set octave 7: 7 (KeyDown) -3:1219:0:103:1 //Set octave 7: Num 7 (KeyDown) +3:1219:0:103:1 //Set octave 7: NUM 7 (KeyDown) 3:1220:0:56:1 //Set octave 8: 8 (KeyDown) -3:1220:0:104:1 //Set octave 8: Num 8 (KeyDown) +3:1220:0:104:1 //Set octave 8: NUM 8 (KeyDown) 3:1221:0:57:1 //Set octave 9: 9 (KeyDown) -3:1221:0:105:1 //Set octave 9: Num 9 (KeyDown) -3:1316:1:16:1 //Chord Modifier: Shift+Shift (KeyDown) -3:1200:0:192:1 //Note cut: ` (KeyDown) +3:1221:0:105:1 //Set octave 9: NUM 9 (KeyDown) +3:1316:1:16:1 //Chord Modifier: Shift (KeyDown) +3:1200:0:192:1 //Note cut: ' (KeyDown) 3:1201:0:187:1 //Note off: = (KeyDown) //----( Pattern Context [bottom] - Ins Col (4) )------------ -4:1202:0:96:1 //Set instrument digit 0: Num 0 (KeyDown) +4:1202:0:96:1 //Set instrument digit 0: NUM 0 (KeyDown) 4:1202:0:48:1 //Set instrument digit 0: 0 (KeyDown) -4:1203:0:97:1 //Set instrument digit 1: Num 1 (KeyDown) +4:1203:0:97:1 //Set instrument digit 1: NUM 1 (KeyDown) 4:1203:0:49:1 //Set instrument digit 1: 1 (KeyDown) -4:1204:0:98:1 //Set instrument digit 2: Num 2 (KeyDown) +4:1204:0:98:1 //Set instrument digit 2: NUM 2 (KeyDown) 4:1204:0:50:1 //Set instrument digit 2: 2 (KeyDown) -4:1205:0:99:1 //Set instrument digit 3: Num 3 (KeyDown) +4:1205:0:99:1 //Set instrument digit 3: NUM 3 (KeyDown) 4:1205:0:51:1 //Set instrument digit 3: 3 (KeyDown) -4:1206:0:100:1 //Set instrument digit 4: Num 4 (KeyDown) +4:1206:0:100:1 //Set instrument digit 4: NUM 4 (KeyDown) 4:1206:0:52:1 //Set instrument digit 4: 4 (KeyDown) -4:1207:0:101:1 //Set instrument digit 5: Num 5 (KeyDown) +4:1207:0:101:1 //Set instrument digit 5: NUM 5 (KeyDown) 4:1207:0:53:1 //Set instrument digit 5: 5 (KeyDown) -4:1208:0:102:1 //Set instrument digit 6: Num 6 (KeyDown) +4:1208:0:102:1 //Set instrument digit 6: NUM 6 (KeyDown) 4:1208:0:54:1 //Set instrument digit 6: 6 (KeyDown) -4:1209:0:103:1 //Set instrument digit 7: Num 7 (KeyDown) +4:1209:0:103:1 //Set instrument digit 7: NUM 7 (KeyDown) 4:1209:0:55:1 //Set instrument digit 7: 7 (KeyDown) 4:1210:0:56:1 //Set instrument digit 8: 8 (KeyDown) -4:1211:0:105:1 //Set instrument digit 9: Num 9 (KeyDown) +4:1211:0:105:1 //Set instrument digit 9: NUM 9 (KeyDown) 4:1211:0:57:1 //Set instrument digit 9: 9 (KeyDown) //----( Pattern Context [bottom] - Vol Col (5) )------------ 5:1222:0:48:1 //Set volume digit 0: 0 (KeyDown) -5:1222:0:96:1 //Set volume digit 0: Num 0 (KeyDown) +5:1222:0:96:1 //Set volume digit 0: NUM 0 (KeyDown) 5:1223:0:49:1 //Set volume digit 1: 1 (KeyDown) -5:1223:0:97:1 //Set volume digit 1: Num 1 (KeyDown) +5:1223:0:97:1 //Set volume digit 1: NUM 1 (KeyDown) 5:1224:0:50:1 //Set volume digit 2: 2 (KeyDown) -5:1224:0:98:1 //Set volume digit 2: Num 2 (KeyDown) +5:1224:0:98:1 //Set volume digit 2: NUM 2 (KeyDown) 5:1225:0:51:1 //Set volume digit 3: 3 (KeyDown) -5:1225:0:99:1 //Set volume digit 3: Num 3 (KeyDown) +5:1225:0:99:1 //Set volume digit 3: NUM 3 (KeyDown) 5:1226:0:52:1 //Set volume digit 4: 4 (KeyDown) -5:1226:0:100:1 //Set volume digit 4: Num 4 (KeyDown) +5:1226:0:100:1 //Set volume digit 4: NUM 4 (KeyDown) 5:1227:0:53:1 //Set volume digit 5: 5 (KeyDown) -5:1227:0:101:1 //Set volume digit 5: Num 5 (KeyDown) +5:1227:0:101:1 //Set volume digit 5: NUM 5 (KeyDown) 5:1228:0:54:1 //Set volume digit 6: 6 (KeyDown) -5:1228:0:102:1 //Set volume digit 6: Num 6 (KeyDown) +5:1228:0:102:1 //Set volume digit 6: NUM 6 (KeyDown) 5:1229:0:55:1 //Set volume digit 7: 7 (KeyDown) -5:1229:0:103:1 //Set volume digit 7: Num 7 (KeyDown) +5:1229:0:103:1 //Set volume digit 7: NUM 7 (KeyDown) 5:1230:0:56:1 //Set volume digit 8: 8 (KeyDown) 5:1231:0:57:1 //Set volume digit 9: 9 (KeyDown) -5:1231:0:105:1 //Set volume digit 9: Num 9 (KeyDown) +5:1231:0:105:1 //Set volume digit 9: NUM 9 (KeyDown) 5:1232:0:86:1 //Vol command - volume: V (KeyDown) 5:1233:0:80:1 //Vol command - pan: P (KeyDown) 5:1234:0:67:1 //Vol command - vol slide up: C (KeyDown) @@ -214,25 +222,25 @@ //----( Pattern Context [bottom] - Param Col (7) )------------ 7:1247:0:48:1 //FX Param digit 0: 0 (KeyDown) -7:1247:0:96:1 //FX Param digit 0: Num 0 (KeyDown) +7:1247:0:96:1 //FX Param digit 0: NUM 0 (KeyDown) 7:1248:0:49:1 //FX Param digit 1: 1 (KeyDown) -7:1248:0:97:1 //FX Param digit 1: Num 1 (KeyDown) +7:1248:0:97:1 //FX Param digit 1: NUM 1 (KeyDown) 7:1249:0:50:1 //FX Param digit 2: 2 (KeyDown) -7:1249:0:98:1 //FX Param digit 2: Num 2 (KeyDown) +7:1249:0:98:1 //FX Param digit 2: NUM 2 (KeyDown) 7:1250:0:51:1 //FX Param digit 3: 3 (KeyDown) -7:1250:0:99:1 //FX Param digit 3: Num 3 (KeyDown) +7:1250:0:99:1 //FX Param digit 3: NUM 3 (KeyDown) 7:1251:0:52:1 //FX Param digit 4: 4 (KeyDown) -7:1251:0:100:1 //FX Param digit 4: Num 4 (KeyDown) +7:1251:0:100:1 //FX Param digit 4: NUM 4 (KeyDown) 7:1252:0:53:1 //FX Param digit 5: 5 (KeyDown) -7:1252:0:101:1 //FX Param digit 5: Num 5 (KeyDown) +7:1252:0:101:1 //FX Param digit 5: NUM 5 (KeyDown) 7:1253:0:54:1 //FX Param digit 6: 6 (KeyDown) -7:1253:0:102:1 //FX Param digit 6: Num 6 (KeyDown) +7:1253:0:102:1 //FX Param digit 6: NUM 6 (KeyDown) 7:1254:0:55:1 //FX Param digit 7: 7 (KeyDown) -7:1254:0:103:1 //FX Param digit 7: Num 7 (KeyDown) +7:1254:0:103:1 //FX Param digit 7: NUM 7 (KeyDown) 7:1255:0:56:1 //FX Param digit 8: 8 (KeyDown) -7:1255:0:104:1 //FX Param digit 8: Num 8 (KeyDown) +7:1255:0:104:1 //FX Param digit 8: NUM 8 (KeyDown) 7:1256:0:57:1 //FX Param digit 9: 9 (KeyDown) -7:1256:0:105:1 //FX Param digit 9: Num 9 (KeyDown) +7:1256:0:105:1 //FX Param digit 9: NUM 9 (KeyDown) 7:1257:0:65:1 //FX Param digit A: A (KeyDown) 7:1258:0:66:1 //FX Param digit B: B (KeyDown) 7:1259:0:67:1 //FX Param digit C: C (KeyDown) @@ -242,12 +250,12 @@ //----( Sample Context [bottom] (8) )------------ 8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) -8:1383:0:8:1 //Silence sample selection: Backspace (KeyDown) +8:1383:0:8:1 //Silence sample selection: BACKSPACE (KeyDown) 8:1385:3:65:1 //Amplify Sample: Shift+Ctrl+A (KeyDown) 8:1381:3:82:1 //Reverse sample: Shift+Ctrl+R (KeyDown) -8:1382:0:46:1 //Delete sample selection: Del (KeyDown) -8:1386:0:107:1 //Zoom Out: Num + (KeyDown) -8:1387:0:109:1 //Zoom In: Num - (KeyDown) +8:1382:0:46:1 //Delete sample selection: DELETE (KeyDown) +8:1386:0:107:1 //Zoom Out: NUM PLUS (KeyDown) +8:1387:0:109:1 //Zoom In: NUM SUB (KeyDown) //----( Instrument Context [bottom] (9) )------------ @@ -257,13 +265,16 @@ //----( Unknown Context (12) )------------ -//----( General Context [top] (13) )------------ +//----( Plugin GUI Context (13) )------------ -//----( Pattern Context [top] (14) )------------ +//----( General Context [top] (14) )------------ -//----( Sample Context [top] (15) )------------ +//----( Pattern Context [top] (15) )------------ -//----( Instrument Context [top] (16) )------------ +//----( Sample Context [top] (16) )------------ -//----( Comments Context [top] (17) )------------ +//----( Instrument Context [top] (17) )------------ +//----( Comments Context [top] (18) )------------ + +//----( Unknown Context (19) )------------ Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2007-05-25 22:09:32 UTC (rev 187) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2007-05-27 17:47:34 UTC (rev 188) @@ -203,11 +203,9 @@ if (m_nMaxMixChannels > MAX_CHANNELS) m_nMaxMixChannels = MAX_CHANNELS; if (gdwMixingFreq < 4000) gdwMixingFreq = 4000; if (gdwMixingFreq > MAX_SAMPLE_RATE) gdwMixingFreq = MAX_SAMPLE_RATE; - //rewbs.resamplerConf - //gnVolumeRampSamples = (gdwMixingFreq * VOLUMERAMPLEN) / 100000; - //if (gnVolumeRampSamples < 8) gnVolumeRampSamples = 8; // - gnVolumeRampSamples = CMainFrame::glVolumeRampSamples; - //end rewbs.resamplerConf + // Start with ramping disabled to avoid clicks on first read. + // Ramping is now set after the first read in CSoundFile::Read(); + gnVolumeRampSamples = 0; gnDryROfsVol = gnDryLOfsVol = 0; #ifndef NO_REVERB gnRvbROfsVol = gnRvbLOfsVol = 0; @@ -394,6 +392,8 @@ lRead -= lCount; m_nBufferCount -= lCount; m_lTotalSampleCount += lCount; // increase sample count for VSTTimeInfo. + // Turn on ramping after first read (fix http://lpchip.com/modplug/viewtopic.php?t=523 ) + gnVolumeRampSamples = CMainFrame::glVolumeRampSamples; } MixDone: if (lRead) memset(lpBuffer, (gnBitsPerSample == 8) ? 0x80 : 0, lRead * lSampleSize); @@ -731,19 +731,19 @@ // Should we process tick0 effects? if (!m_nMusicSpeed) m_nMusicSpeed = 1; m_dwSongFlags |= SONG_FIRSTTICK; + + //End of row? stop pattern step (aka "play row"). + if (m_nTickCount >= m_nMusicSpeed * (m_nPatternDelay+1) + m_nFrameDelay - 1) { + #ifdef MODPLUG_TRACKER + if (m_dwSongFlags & SONG_STEP) { + m_dwSongFlags &= ~SONG_STEP; + m_dwSongFlags |= SONG_PAUSED; + } + #endif // MODPLUG_TRACKER + } + if (m_nTickCount) { - //End of row? stop pattern step (aka "play row"). - if (m_nTickCount >= m_nMusicSpeed * (m_nPatternDelay+1) + m_nFrameDelay - 1) { - #ifdef MODPLUG_TRACKER - if (m_dwSongFlags & SONG_STEP) { - m_dwSongFlags &= ~SONG_STEP; - m_dwSongFlags |= SONG_PAUSED; - } - #endif // MODPLUG_TRACKER - } - - m_dwSongFlags &= ~SONG_FIRSTTICK; if ((!(m_nType & MOD_TYPE_XM)) && (m_nTickCount < m_nMusicSpeed * (1 + m_nPatternDelay))) { @@ -1884,7 +1884,7 @@ VOID CSoundFile::ApplyGlobalVolume(int SoundBuffer[], long lTotalSampleCount) -//-------------------------------------------------------- +//--------------------------------------------------------------------------- { long delta=0; long step=0; @@ -1915,6 +1915,7 @@ m_nSamplesToGlobalVolRampDest--; } else { SoundBuffer[pos] = _muldiv(SoundBuffer[pos], m_nGlobalVolume, MAX_GLOBAL_VOLUME); + m_lHighResRampingGlobalVolume = m_nGlobalVolume<<VOLUMERAMPPRECISION; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <re...@us...> - 2007-06-17 16:24:19
|
Revision: 189 http://svn.sourceforge.net/modplug/?rev=189&view=rev Author: rewbs Date: 2007-06-17 09:24:14 -0700 (Sun, 17 Jun 2007) Log Message: ----------- Applying Pelya's patch with minor formatting and variable/method name changes. Thanks Pelya! + <Pelya> Allow Window key as a modifier in the keyboard configuration. Disables start menu pop-up when pressing the Win key if and only if it used in the active keyboard configuration. + <Pelya> Disables NumLock/CapsLock/ScrollLock lamps on keyboard if and only if they are used in the active keyboard configuration. The lamps will blink anyway - can't help it until we start using DirectInput. Modified Paths: -------------- trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/InputHandler.h trunk/OpenMPT/packageTemplate/Installation.txt Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2007-05-27 17:47:34 UTC (rev 188) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2007-06-17 16:24:14 UTC (rev 189) @@ -2814,7 +2814,8 @@ for (int k=0; k<commands[curCmd].kcList.GetSize(); k++) { curKc = commands[curCmd].kcList[k]; - if ((!curKc.mod) || (curKc.code!=VK_SHIFT && curKc.code!=VK_CONTROL && curKc.code!=VK_MENU && curKc.code!=0)) + if ((!curKc.mod) || (curKc.code!=VK_SHIFT && curKc.code!=VK_CONTROL && curKc.code!=VK_MENU && curKc.code!=0 && + curKc.code!=VK_LWIN && curKc.code!=VK_RWIN )) // Feature: use Windows keys as modifier keys { report+="Error! " + GetCommandText((CommandID)curCmd) + " must be a modifier (shift/ctrl/alt), but is currently " + GetKeyText(inKc.mod, inKc.code) + "\r\n"; //replace with dummy @@ -2880,6 +2881,7 @@ case VK_SHIFT: return HOTKEYF_SHIFT; case VK_MENU: return HOTKEYF_ALT; case VK_CONTROL: return HOTKEYF_CONTROL; + case VK_LWIN: case VK_RWIN: return HOTKEYF_EXT; // Feature: use Windows keys as modifier keys default: /*DEBUG: ASSERT(false);*/ return 0; //can only get modifier for modifier key } @@ -2897,9 +2899,6 @@ //Clear map memset(km, -1, sizeof(kcNull)*KeyMapSize); -// km.RemoveAll(); -// km.InitHashTable(700423); - //Copy commandlist content into map: for (UINT cmd=0; cmd<kcNumCommands; cmd++) @@ -3216,6 +3215,7 @@ if (mod & HOTKEYF_SHIFT) text.Append("Shift+"); if (mod & HOTKEYF_CONTROL) text.Append("Ctrl+"); if (mod & HOTKEYF_ALT) text.Append("Alt+"); + if (mod & HOTKEYF_EXT) text.Append("Win+"); // Feature: use Windows keys as modifier keys return text; } @@ -3436,4 +3436,4 @@ return conflict; } -//end rewbs.customKeys \ No newline at end of file +//end rewbs.customKeys Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2007-05-27 17:47:34 UTC (rev 188) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2007-06-17 16:24:14 UTC (rev 189) @@ -35,6 +35,8 @@ //Get Keymap activeCommandSet->GenKeyMap(keyMap); + SetupSpecialKeyInterception(); // Feature: use Windows keys as modifier keys, intercept special keys + m_nSkipGeneratedKeypresses = 0; m_bDistinguishControls = false; m_bDistinguishShifts = false; @@ -54,38 +56,37 @@ //-------------------------------------------------------------- - - CommandID CInputHandler::GeneralKeyEvent(InputTargetContext context, int code, WPARAM wParam , LPARAM lParam) - { CommandID executeCommand = kcNull; KeyEventType keyEventType; - if (code == HC_ACTION) - { + if (code == HC_ACTION) { //Get the KeyEventType (key up, key down, key repeat) DWORD scancode = lParam >> 16; - if ((scancode & 0xC000) == 0xC000) keyEventType = kKeyEventUp; - else if ((scancode & 0xC000) == 0x0000) keyEventType = kKeyEventDown; - else keyEventType = kKeyEventRepeat; + if ((scancode & 0xC000) == 0xC000) { + keyEventType = kKeyEventUp; + } else if ((scancode & 0xC000) == 0x0000) { + keyEventType = kKeyEventDown; + } else { + keyEventType = kKeyEventRepeat; + } - //Catch modifier change (ctrl, alt, shift) - Only check on keyDown or keyUp. - if (keyEventType == kKeyEventUp || keyEventType == kKeyEventDown) - { + // Catch modifier change (ctrl, alt, shift) - Only check on keyDown or keyUp. + // NB: we want to catch modifiers even when the input handler is locked + if (keyEventType == kKeyEventUp || keyEventType == kKeyEventDown) { scancode =(lParam >> 16) & 0x1FF; CatchModifierChange(wParam, keyEventType, scancode); } - if (keyEventType == kKeyEventUp) - keyEventType=kKeyEventUp; - - if (!Bypass()) // If bypassing, we want to catch modifiers but not execute commands + if (!InterceptSpecialKeys( wParam, lParam ) && !Bypass()) { + // only execute command when the input handler is not locked + // and the input is not a consequence of special key interception. executeCommand = keyMap[context][modifierMask][wParam][keyEventType]; + } } - if (m_pMainFrm && executeCommand != kcNull) - { + if (m_pMainFrm && executeCommand != kcNull) { m_pMainFrm->PostMessage(WM_MOD_KEYCOMMAND, executeCommand, wParam); } @@ -111,7 +112,65 @@ return executeCommand; } +// Feature: use Windows keys as modifier keys, intercept special keys +bool CInputHandler::InterceptSpecialKeys( UINT nChar , UINT nFlags ) +{ + KeyEventType keyEventType = GetKeyEventType( HIWORD(nFlags) ); + enum { VK_NonExistentKey = VK_F24+1 }; + + if( nChar == VK_NonExistentKey ) { + return true; + } else if( m_bInterceptWindowsKeys && ( nChar == VK_LWIN || nChar == VK_RWIN ) ) { + if( keyEventType == kKeyEventDown ) { + INPUT inp[2]; + inp[0].type = inp[1].type = INPUT_KEYBOARD; + inp[0].ki.time = inp[1].ki.time = 0; + inp[0].ki.dwExtraInfo = inp[0].ki.dwExtraInfo = 0; + inp[0].ki.wVk = inp[1].ki.wVk = VK_NonExistentKey; + inp[0].ki.wScan = inp[1].ki.wScan = 0; + inp[0].ki.dwFlags = 0; + inp[1].ki.dwFlags = KEYEVENTF_KEYUP; + SendInput( 2, inp, sizeof(INPUT) ); + } + } + + if( ( nChar == VK_NUMLOCK && m_bInterceptNumLock ) || + ( nChar == VK_CAPITAL && m_bInterceptCapsLock ) || + ( nChar == VK_SCROLL && m_bInterceptScrollLock ) ) { + if( m_nSkipGeneratedKeypresses > 0 ) { + m_nSkipGeneratedKeypresses -- ; + return true; + } else if( keyEventType == kKeyEventDown ) { + m_nSkipGeneratedKeypresses = 2; + INPUT inp[2]; + inp[0].type = inp[1].type = INPUT_KEYBOARD; + inp[0].ki.time = inp[1].ki.time = 0; + inp[0].ki.dwExtraInfo = inp[0].ki.dwExtraInfo = 0; + inp[0].ki.wVk = inp[1].ki.wVk = nChar; + inp[0].ki.wScan = inp[1].ki.wScan = 0; + inp[0].ki.dwFlags = KEYEVENTF_KEYUP; + inp[1].ki.dwFlags = 0; + SendInput( 2, inp, sizeof(INPUT) ); + } + } + return false; +}; +void CInputHandler::SetupSpecialKeyInterception() +{ + m_bInterceptWindowsKeys = m_bInterceptNumLock = m_bInterceptCapsLock = m_bInterceptScrollLock = false; + for( int context=0; context<sizeof(keyMap)/sizeof(keyMap[0]); context++ ) + for( int mod=0; mod<sizeof(keyMap[0])/sizeof(keyMap[0][0]); mod++ ) + for( int key=0; key<sizeof(keyMap[0][0])/sizeof(keyMap[0][0][0]); key++ ) + for( int kevent=0; kevent<sizeof(keyMap[0][0][0])/sizeof(keyMap[0][0][0][0]); kevent++ ) { + if( keyMap[context][mod][key][kevent] == kcNull ) continue; + if( mod == HOTKEYF_EXT ) m_bInterceptWindowsKeys = true; + if( key == VK_NUMLOCK ) m_bInterceptNumLock = true; + if( key == VK_CAPITAL ) m_bInterceptCapsLock = true; + if( key == VK_SCROLL ) m_bInterceptScrollLock = true; + }; +}; + //-------------------------------------------------------------- //Deal with Modifier keypresses. Private surouting used above. bool CInputHandler::CatchModifierChange(WPARAM wParam, KeyEventType keyEventType, int scancode) @@ -156,6 +215,9 @@ */ tempModifierMask |= HOTKEYF_ALT; break; // } + case VK_LWIN: case VK_RWIN: // Feature: use Windows keys as modifier keys + tempModifierMask |= HOTKEYF_EXT; + break; } if (tempModifierMask) //This keypress just changed the modifier mask @@ -236,9 +298,9 @@ if (mask & HOTKEYF_CONTROL) Log("Ctrl On"); else Log("Ctrl --"); if (mask & HOTKEYF_SHIFT) Log("\tShft On"); else Log("\tShft --"); if (mask & HOTKEYF_ALT) Log("\tAlt On\n"); else Log("\tAlt --\n"); + if (mask & HOTKEYF_EXT) Log("\tWin On\n"); else Log("\tWin --\n"); // Feature: use Windows keys as modifier keys } - KeyEventType CInputHandler::GetKeyEventType(UINT nFlags) { if (nFlags & TRANSITIONBIT) //Key released @@ -439,6 +501,7 @@ { activeCommandSet->Copy(newSet); activeCommandSet->GenKeyMap(keyMap); + SetupSpecialKeyInterception(); // Feature: use Windows keys as modifier keys, intercept special keys UpdateMainMenu(); } @@ -488,4 +551,4 @@ return true; return false; -} \ No newline at end of file +} Modified: trunk/OpenMPT/mptrack/InputHandler.h =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.h 2007-05-27 17:47:34 UTC (rev 188) +++ trunk/OpenMPT/mptrack/InputHandler.h 2007-06-17 16:24:14 UTC (rev 189) @@ -66,6 +66,10 @@ bool m_bNoAltMenu; bool m_bDistinguishControls, m_bDistinguishShifts, m_bDistinguishAlts; bool CatchModifierChange(WPARAM wParam, KeyEventType keyEventType, int scancode); + bool m_bInterceptWindowsKeys, m_bInterceptNumLock, m_bInterceptCapsLock, m_bInterceptScrollLock; + int m_nSkipGeneratedKeypresses; + bool InterceptSpecialKeys( UINT nChar , UINT nFlags ); + void SetupSpecialKeyInterception(); public: CCommandSet *activeCommandSet; @@ -88,3 +92,4 @@ bool SetITEffects(void); }; + Modified: trunk/OpenMPT/packageTemplate/Installation.txt =================================================================== --- trunk/OpenMPT/packageTemplate/Installation.txt 2007-05-27 17:47:34 UTC (rev 188) +++ trunk/OpenMPT/packageTemplate/Installation.txt 2007-06-17 16:24:14 UTC (rev 189) @@ -1,5 +1,6 @@ OpenMPT development build - Installation notes ---------------------------------------------- -. If you have an existing installation of OpenMPT and wish to re-use its settings, copy your mptrack.ini to this directory. -. If not, you're done: just launch mptrack.exe. +. If you have an existing installation of OpenMPT and wish to re-use its settings, + copy your mptrack.ini and plugin.cache to the directory into which you extract the archive. +. If not, you're done: just extract the archive and launch mptrack.exe. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Rel...@us...> - 2007-11-17 18:00:04
|
Revision: 192 http://modplug.svn.sourceforge.net/modplug/?rev=192&view=rev Author: Relabsoluness Date: 2007-11-17 09:59:58 -0800 (Sat, 17 Nov 2007) Log Message: ----------- + Improved VST preset navigation in VST window. Known problem: doesn't update if preset is changed from VSTs own preset navigation. + Improvements in IT compatibility playmode. When loading ITs, if file doesn't seem modplug made, then automatically setting IT compatibility playmode. The playmode setting can be toggled in song properties dialog, and the autodetection with an ini setting. + 'key binding not understood'-messages can be disabled with an ini setting. . Fixed wrong file version in IT compatibility save. (http://lpchip.com/modplug/viewtopic.php?t=1723) . Fixed possible unnotified overwriting of file occurring for example when dealing with a new file. (http://lpchip.com/modplug/viewtopic.php?t=1813) . Fixed broken note preview for certain type of instruments in instrument tab. (http://lpchip.com/modplug/viewtopic.php?t=1996) . Fixed possible crash on channel mode wav export when a channel has a long name. (http://lpchip.com/modplug/viewtopic.php?t=2005) . Fixed pattern position indicator jump when clicking VST-box in channel header. (http://lpchip.com/modplug/viewtopic.php?t=2014) . CMainFrame::m_csExecutablePath renamed and should now contain the path of executable directory, not that of the working directory. / Tuning related changes/improvements Modified Paths: -------------- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/AbstractVstEditor.h trunk/OpenMPT/mptrack/AutoSaver.cpp trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_ins.h trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/OrderToPatternTable.cpp trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/mptrack/TuningDialog.h trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/bin/tunings/standard/std_tunings.tc trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/mptrack/misc_util.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/pattern.cpp trunk/OpenMPT/mptrack/pattern.h trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/mptrack/serialization_utils.cpp trunk/OpenMPT/mptrack/serialization_utils.h trunk/OpenMPT/mptrack/tuningRatioMapWnd.cpp trunk/OpenMPT/mptrack/tuningRatioMapWnd.h trunk/OpenMPT/mptrack/typedefs.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/mod_specifications.h trunk/OpenMPT/soundlib/modcommand.h trunk/OpenMPT/soundlib/tuning.cpp trunk/OpenMPT/soundlib/tuning.h trunk/OpenMPT/soundlib/tuningCollection.cpp trunk/OpenMPT/soundlib/tuningcollection.h trunk/OpenMPT/soundlib/wavConverter.h Added Paths: ----------- trunk/OpenMPT/soundlib/load_mptm.cpp trunk/OpenMPT/soundlib/tuningbase.cpp trunk/OpenMPT/soundlib/tuningbase.h Removed Paths: ------------- trunk/OpenMPT/mptrack/bin/tunings/local_tunings.tc trunk/OpenMPT/soundlib/tuning_template.h Property Changed: ---------------- trunk/OpenMPT/mptrack/ Property changes on: trunk/OpenMPT/mptrack ___________________________________________________________________ Name: svn:ignore + *.sln *.vcproj Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -21,6 +21,10 @@ ON_COMMAND(ID_PRESET_RANDOM, OnRandomizePreset) ON_COMMAND(ID_VSTMACRO_INFO, OnMacroInfo) ON_COMMAND(ID_VSTINPUT_INFO, OnInputInfo) + ON_COMMAND(ID_PREVIOUSVSTPRESET, OnSetPreviousVSTPreset) + ON_COMMAND(ID_NEXTVSTPRESET, OnSetNextVSTPreset) + ON_COMMAND(ID_VSTPRESETBACKWARDJUMP,OnVSTPresetBackwardJump) + ON_COMMAND(ID_VSTPRESETFORWARDJUMP, OnVSTPresetForwardJump) ON_COMMAND_RANGE(ID_PRESET_SET, ID_PRESET_SET+MAX_PLUGPRESETS, OnSetPreset) ON_MESSAGE(WM_MOD_KEYCOMMAND, OnCustomKeyMsg) //rewbs.customKeys ON_COMMAND_RANGE(ID_PLUGSELECT, ID_PLUGSELECT+MAX_MIXPLUGINS, OnToggleEditor) //rewbs.patPlugName @@ -36,7 +40,7 @@ m_pInputMenu = new CMenu(); m_pOutputMenu = new CMenu(); m_pMacroMenu = new CMenu(); - + m_pPresetMenu = new CMenu(); m_pPresetMenuGroup.SetSize(0); @@ -137,17 +141,50 @@ UpdateOutputMenu(); UpdateMacroMenu(); UpdateOptionsMenu(); + UpdatePresetField(); ::SetMenu(m_hWnd, m_pMenu->m_hMenu); } return; } +void CAbstractVstEditor::UpdatePresetField() +//------------------------------------------ +{ + if(m_pVstPlugin->GetNumPrograms() > 0 && m_pMenu->GetMenuItemCount() < 5) + { + m_pMenu->InsertMenu(4, MF_BYPOSITION, ID_VSTPRESETBACKWARDJUMP, (LPCTSTR)"<<"); + m_pMenu->InsertMenu(5, MF_BYPOSITION, ID_PREVIOUSVSTPRESET, (LPCTSTR)"<"); + m_pMenu->InsertMenu(6, MF_BYPOSITION, ID_NEXTVSTPRESET, (LPCTSTR)">"); + m_pMenu->InsertMenu(7, MF_BYPOSITION, ID_VSTPRESETFORWARDJUMP, (LPCTSTR)">>"); + m_pMenu->InsertMenu(8, MF_BYPOSITION|MF_DISABLED, 0, ""); + } + + long index = m_pVstPlugin->GetCurrentProgram(); + char name[256+6]; + memset(name, ' ', 6); + itoa(index, name, 10); + size_t i = 4; + if(index < 1000) i = 3; + if(index < 100) i = 2; + if(index < 10) i = 1; + name[i] = ':'; name[i+1] = ' '; + + m_pVstPlugin->GetProgramNameIndexed(index, -1, name+i+2); + + m_pMenu->ModifyMenu(8, MF_BYPOSITION, 0, name); + DrawMenuBar(); +} + + void CAbstractVstEditor::OnSetPreset(UINT nID) +//--------------------------------------------- { int nIndex=nID-ID_PRESET_SET; if (nIndex>=0) { m_pVstPlugin->SetCurrentProgram(nIndex); + UpdatePresetField(); + //SetupMenu(); } } @@ -254,8 +291,8 @@ switch(wParam) { - case kcVSTGUIPrevPreset: OnSetPreset(-1+ID_PRESET_SET+m_pVstPlugin->GetCurrentProgram()); return wParam; - case kcVSTGUINextPreset: OnSetPreset( 1+ID_PRESET_SET+m_pVstPlugin->GetCurrentProgram()); return wParam; + case kcVSTGUIPrevPreset: OnSetPreviousVSTPreset(); return wParam; + case kcVSTGUINextPreset: OnSetNextVSTPreset(); return wParam; case kcVSTGUIRandParams: OnRandomizePreset() ; return wParam; } if (wParam>=kcVSTGUIStartNotes && wParam<=kcVSTGUIEndNotes) @@ -301,6 +338,8 @@ char s[256]; char sname[256]; + + if (m_pPresetMenu->m_hMenu) // We rebuild menu from scratch { // So remove any exiting menus... if (curProg == m_nCurProg) //.. unless menu exists and is accurate, @@ -603,6 +642,30 @@ m_nInstrument = (nID-ID_SELECTINST); } +void CAbstractVstEditor::OnSetPreviousVSTPreset() +//-------------------------------------------- +{ + OnSetPreset(-1+ID_PRESET_SET+m_pVstPlugin->GetCurrentProgram()); +} + +void CAbstractVstEditor::OnSetNextVSTPreset() +//---------------------------------------- +{ + OnSetPreset(1+ID_PRESET_SET+m_pVstPlugin->GetCurrentProgram()); +} + +void CAbstractVstEditor::OnVSTPresetBackwardJump() +//------------------------------------------------ +{ + OnSetPreset(max(ID_PRESET_SET+m_pVstPlugin->GetCurrentProgram()-10, ID_PRESET_SET)); +} + +void CAbstractVstEditor::OnVSTPresetForwardJump() +//---------------------------------------------------- +{ + OnSetPreset(min(10+ID_PRESET_SET+m_pVstPlugin->GetCurrentProgram(), ID_PRESET_SET+m_pVstPlugin->GetNumPrograms()-1)); +} + void CAbstractVstEditor::PrepareToLearnMacro(UINT nID) { m_nLearnMacro = (nID-ID_LEARN_MACRO_FROM_PLUGGUI); Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.h =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.h 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.h 2007-11-17 17:59:58 UTC (rev 192) @@ -20,6 +20,8 @@ void SetLearnMacro(int inMacro); int GetLearnMacro(); + void UpdatePresetField(); + afx_msg void OnLoadPreset(); afx_msg void OnSavePreset(); afx_msg void OnRandomizePreset(); @@ -29,6 +31,10 @@ afx_msg void OnBypassPlug(); afx_msg void OnRecordAutomation(); afx_msg void OnPassKeypressesToPlug(); + afx_msg void OnSetPreviousVSTPreset(); + afx_msg void OnSetNextVSTPreset(); + afx_msg void OnVSTPresetBackwardJump(); + afx_msg void OnVSTPresetForwardJump(); afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys //Overridden methods: Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -185,7 +185,7 @@ if (pModDoc->m_bHasValidPath) { // Check that the file has a user-chosen path name = pModDoc->GetPathName(); } else { // if it doesnt, put it in executable dir - name = CMainFrame::m_csExecutablePath + "\\" + pModDoc->GetTitle(); + name = CMainFrame::m_csExecutableDirectoryPath + pModDoc->GetTitle(); } } else { @@ -263,7 +263,7 @@ CString fullPath = pModDoc->GetPathName(); path = fullPath.Left(fullPath.GetLength()-pModDoc->GetTitle().GetLength()); //remove file name if necessary } else { - path = CMainFrame::m_csExecutablePath + "\\"; + path = CMainFrame::m_csExecutableDirectoryPath; } } else { path = m_csPath; Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -171,7 +171,8 @@ if(!m_pSndFile || !pModDoc) return; - // Stop player + + // Stop player (is this necessary?) CModDoc *pActiveMod = NULL; HWND followSong = pMainFrm->GetFollowSong(pModDoc); if(pMainFrm->IsPlaying()){ @@ -181,9 +182,7 @@ EnterCriticalSection(&applying); - MODCOMMAND *p = NULL,*newp = NULL; - MODCHANNELSETTINGS settings[MAX_BASECHANNELS]; - UINT i,j,k,nChannels,newpat[MAX_BASECHANNELS],newMemory[4][MAX_BASECHANNELS]; + UINT i,nChannels,newpat[MAX_BASECHANNELS],newMemory[4][MAX_BASECHANNELS]; // Count new number of channels , copy pattern pointers & manager internal store memory nChannels = 0; @@ -514,7 +513,7 @@ InvalidateRect(NULL,FALSE); } -void CChannelManagerDlg::OnTabSelchange(NMHDR* header, LRESULT* pResult) +void CChannelManagerDlg::OnTabSelchange(NMHDR* /*header*/, LRESULT* /*pResult*/) { if(!show) return; @@ -557,7 +556,7 @@ InvalidateRect(NULL, FALSE); } -void DrawChannelButton(HDC hdc, LPRECT lpRect, LPCSTR lpszText, BOOL bActivate, BOOL bEnable, DWORD dwFlags, HBRUSH markBrush) +void DrawChannelButton(HDC hdc, LPRECT lpRect, LPCSTR lpszText, BOOL bActivate, BOOL bEnable, DWORD dwFlags, HBRUSH /*markBrush*/) { RECT rect; rect = (*lpRect); @@ -609,27 +608,27 @@ CRect wnd,btn; GetWindowRect(&wnd); - if(button = GetDlgItem(IDC_BUTTON1)){ + if((button = GetDlgItem(IDC_BUTTON1)) != 0){ button->GetWindowRect(&btn); button->SetWindowPos(NULL,btn.left-wnd.left-3,wnd.Height()-btn.Height()*2-6,0,0,SWP_NOSIZE | SWP_NOZORDER); } - if(button = GetDlgItem(IDC_BUTTON2)){ + if((button = GetDlgItem(IDC_BUTTON2)) != 0){ button->GetWindowRect(&btn); button->SetWindowPos(NULL,btn.left-wnd.left-3,wnd.Height()-btn.Height()*2-6,0,0,SWP_NOSIZE | SWP_NOZORDER); } - if(button = GetDlgItem(IDC_BUTTON3)){ + if((button = GetDlgItem(IDC_BUTTON3)) != 0){ button->GetWindowRect(&btn); button->SetWindowPos(NULL,btn.left-wnd.left-3,wnd.Height()-btn.Height()*2-6,0,0,SWP_NOSIZE | SWP_NOZORDER); } - if(button = GetDlgItem(IDC_BUTTON4)){ + if((button = GetDlgItem(IDC_BUTTON4)) != 0){ button->GetWindowRect(&btn); button->SetWindowPos(NULL,btn.left-wnd.left-3,wnd.Height()-btn.Height()*2-6,0,0,SWP_NOSIZE | SWP_NOZORDER); } - if(button = GetDlgItem(IDC_BUTTON5)){ + if((button = GetDlgItem(IDC_BUTTON5)) != 0){ button->GetWindowRect(&btn); button->SetWindowPos(NULL,btn.left-wnd.left-3,wnd.Height()-btn.Height()*2-6,0,0,SWP_NOSIZE | SWP_NOZORDER); } - if(button = GetDlgItem(IDC_BUTTON6)){ + if((button = GetDlgItem(IDC_BUTTON6)) != 0){ button->GetWindowRect(&btn); button->SetWindowPos(NULL,btn.left-wnd.left-3,wnd.Height()-btn.Height()*2-6,0,0,SWP_NOSIZE | SWP_NOZORDER); } @@ -856,9 +855,9 @@ CSoundFile * m_pSndFile = pModDoc ? pModDoc->GetSoundFile() : NULL; if(pModDoc && m_pSndFile){ - UINT nChannels = m_pSndFile->m_nChannels; + //UINT nChannels = m_pSndFile->m_nChannels; UINT nColns = CM_NB_COLS; - UINT nLines = nChannels / nColns + (nChannels % nColns ? 1 : 0); + //UINT nLines = nChannels / nColns + (nChannels % nColns ? 1 : 0); int x = point.x - client.left; int y = point.y - client.top; @@ -905,7 +904,7 @@ if(order) nChannelsOld = 0; } -LRESULT CChannelManagerDlg::OnMouseLeave(WPARAM wparam, LPARAM lparam) +LRESULT CChannelManagerDlg::OnMouseLeave(WPARAM /*wparam*/, LPARAM /*lparam*/) { if(!m_hWnd || show == FALSE) return 0; @@ -917,7 +916,7 @@ return 0; } -LRESULT CChannelManagerDlg::OnMouseHover(WPARAM wparam, LPARAM lparam) +LRESULT CChannelManagerDlg::OnMouseHover(WPARAM /*wparam*/, LPARAM /*lparam*/) { if(!m_hWnd || show == FALSE) return 0; @@ -954,7 +953,7 @@ LeaveCriticalSection(&applying); } -void CChannelManagerDlg::OnLButtonUp(UINT nFlags,CPoint point) +void CChannelManagerDlg::OnLButtonUp(UINT /*nFlags*/,CPoint point) { if(!m_hWnd || show == FALSE) return; @@ -1034,7 +1033,7 @@ LeaveCriticalSection(&applying); } -void CChannelManagerDlg::OnRButtonUp(UINT nFlags,CPoint point) +void CChannelManagerDlg::OnRButtonUp(UINT /*nFlags*/,CPoint /*point*/) { if(!m_hWnd || show == FALSE) return; @@ -1186,7 +1185,7 @@ return CModControlDlg::OnMouseWheel(nFlags, zDelta, pt); } -BOOL CCtrlPatterns::OnToolTip(UINT id, NMHDR *pNMHDR, LRESULT *pResult) +BOOL CCtrlPatterns::OnToolTip(UINT /*id*/, NMHDR *pNMHDR, LRESULT* /*pResult*/) //--------------------------------------------------------------------- { TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR; Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -5,6 +5,8 @@ #include <stdio.h> #include <stdlib.h> +bool CCommandSet::s_bShowErrorOnUnknownKeybinding = true; + CCommandSet::CCommandSet(void) { // Which keybinding rules to enforce? @@ -23,7 +25,6 @@ enforceRule[krPropagateSampleManipulation] = true; // enforceRule[krCheckContextHierarchy] = true; - commands.SetSize(kcNumCommands); SetupCommands(); SetupContextHierarchy(); @@ -3120,11 +3121,11 @@ CString err; if (errorCount<10) { err.Format("Line %d in key binding file %s was not understood.", l, fileName); - ::MessageBox(NULL, err, "", MB_ICONEXCLAMATION|MB_OK); + if(s_bShowErrorOnUnknownKeybinding) ::MessageBox(NULL, err, "", MB_ICONEXCLAMATION|MB_OK); Log(err); } else if (errorCount==10) { err.Format("Too many errors detected, not reporting any more."); - ::MessageBox(NULL, err, "", MB_ICONEXCLAMATION|MB_OK); + if(s_bShowErrorOnUnknownKeybinding) ::MessageBox(NULL, err, "", MB_ICONEXCLAMATION|MB_OK); Log(err); } } Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/CommandSet.h 2007-11-17 17:59:58 UTC (rev 192) @@ -1053,8 +1053,10 @@ //CArray<CArray<bool,bool>, CArray<bool,bool> > m_isParentContext; bool m_isParentContext[kCtxMaxInputContexts][kCtxMaxInputContexts]; bool enforceRule[kNumRules]; + +public: + static bool s_bShowErrorOnUnknownKeybinding; -public: CCommandSet(void); ~CCommandSet(void); Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -2435,18 +2435,18 @@ sel -= 1; CTuningCollection* tc = 0; - if(sel < CSoundFile::s_TuningsSharedStandard.GetNumTunings()) - tc = &CSoundFile::s_TuningsSharedStandard; + if(sel < CSoundFile::GetStandardTunings().GetNumTunings()) + tc = &CSoundFile::GetStandardTunings(); else { - sel -= CSoundFile::s_TuningsSharedStandard.GetNumTunings(); - if(sel < CSoundFile::s_TuningsSharedLocal.GetNumTunings()) - tc = &CSoundFile::s_TuningsSharedLocal; + sel -= CSoundFile::GetStandardTunings().GetNumTunings(); + if(sel < CSoundFile::GetLocalTunings().GetNumTunings()) + tc = &CSoundFile::GetLocalTunings(); else { - sel -= CSoundFile::s_TuningsSharedLocal.GetNumTunings(); - if(sel < m_pSndFile->m_TuningsTuneSpecific.GetNumTunings()) - tc = &m_pSndFile->m_TuningsTuneSpecific; + sel -= CSoundFile::GetLocalTunings().GetNumTunings(); + if(sel < m_pSndFile->GetTuneSpecificTunings().GetNumTunings()) + tc = &m_pSndFile->GetTuneSpecificTunings(); } } @@ -2463,17 +2463,17 @@ //Case: Chosen tuning editor to be displayed. //Creating vector for the CTuningDialog. vector<CTuningCollection*> v; - v.push_back(&m_pSndFile->s_TuningsSharedStandard); - v.push_back(&m_pSndFile->s_TuningsSharedLocal); - v.push_back(&m_pSndFile->m_TuningsTuneSpecific); + v.push_back(&m_pSndFile->GetStandardTunings()); + v.push_back(&m_pSndFile->GetLocalTunings()); + v.push_back(&m_pSndFile->GetTuneSpecificTunings()); CTuningDialog td(this, v, pInstH->pTuning); td.DoModal(); - if(td.GetModifiedStatus(&m_pSndFile->s_TuningsSharedLocal)) + if(td.GetModifiedStatus(&m_pSndFile->GetLocalTunings())) { if(MsgBox(IDS_APPLY_TUNING_MODIFICATIONS, this, "", MB_OKCANCEL) == IDOK) m_pSndFile->SaveStaticTunings(); } - if(td.GetModifiedStatus(&m_pSndFile->m_TuningsTuneSpecific)) + if(td.GetModifiedStatus(&m_pSndFile->GetTuneSpecificTunings())) { m_pModDoc->SetModified(); } @@ -2500,29 +2500,29 @@ return; } - for(size_t i = 0; i < CSoundFile::s_TuningsSharedStandard.GetNumTunings(); i++) + for(size_t i = 0; i < CSoundFile::GetStandardTunings().GetNumTunings(); i++) { - if(penv->pTuning == &CSoundFile::s_TuningsSharedStandard.GetTuning(i)) + if(penv->pTuning == &CSoundFile::GetStandardTunings().GetTuning(i)) { m_ComboTuning.SetCurSel(i+1); return; } } - for(size_t i = 0; i < CSoundFile::s_TuningsSharedLocal.GetNumTunings(); i++) + for(size_t i = 0; i < CSoundFile::GetLocalTunings().GetNumTunings(); i++) { - if(penv->pTuning == &CSoundFile::s_TuningsSharedLocal.GetTuning(i)) + if(penv->pTuning == &CSoundFile::GetLocalTunings().GetTuning(i)) { - m_ComboTuning.SetCurSel(i+CSoundFile::s_TuningsSharedStandard.GetNumTunings()+1); + m_ComboTuning.SetCurSel(i+CSoundFile::GetStandardTunings().GetNumTunings()+1); return; } } - for(size_t i = 0; i < m_pSndFile->m_TuningsTuneSpecific.GetNumTunings(); i++) + for(size_t i = 0; i < m_pSndFile->GetTuneSpecificTunings().GetNumTunings(); i++) { - if(penv->pTuning == &m_pSndFile->m_TuningsTuneSpecific.GetTuning(i)) + if(penv->pTuning == &m_pSndFile->GetTuneSpecificTunings().GetTuning(i)) { - m_ComboTuning.SetCurSel(i+CSoundFile::s_TuningsSharedStandard.GetNumTunings() + CSoundFile::s_TuningsSharedLocal.GetNumTunings()+1); + m_ComboTuning.SetCurSel(i+CSoundFile::GetStandardTunings().GetNumTunings() + CSoundFile::GetLocalTunings().GetNumTunings()+1); return; } } @@ -2637,17 +2637,17 @@ m_ComboTuning.DeleteString(0); m_ComboTuning.AddString("OMPT IT behavior"); //<-> Instrument pTuning pointer == NULL - for(size_t i = 0; i<CSoundFile::s_TuningsSharedStandard.GetNumTunings(); i++) + for(size_t i = 0; i<CSoundFile::GetStandardTunings().GetNumTunings(); i++) { - m_ComboTuning.AddString(CSoundFile::s_TuningsSharedStandard.GetTuning(i).GetName().c_str()); + m_ComboTuning.AddString(CSoundFile::GetStandardTunings().GetTuning(i).GetName().c_str()); } - for(size_t i = 0; i<CSoundFile::s_TuningsSharedLocal.GetNumTunings(); i++) + for(size_t i = 0; i<CSoundFile::GetLocalTunings().GetNumTunings(); i++) { - m_ComboTuning.AddString(CSoundFile::s_TuningsSharedLocal.GetTuning(i).GetName().c_str()); + m_ComboTuning.AddString(CSoundFile::GetLocalTunings().GetTuning(i).GetName().c_str()); } - for(size_t i = 0; i<m_pSndFile->m_TuningsTuneSpecific.GetNumTunings(); i++) + for(size_t i = 0; i<m_pSndFile->GetTuneSpecificTunings().GetNumTunings(); i++) { - m_ComboTuning.AddString(m_pSndFile->m_TuningsTuneSpecific.GetTuning(i).GetName().c_str()); + m_ComboTuning.AddString(m_pSndFile->GetTuneSpecificTunings().GetTuning(i).GetName().c_str()); } m_ComboTuning.AddString("Control tunings..."); m_ComboTuning.SetCurSel(0); Modified: trunk/OpenMPT/mptrack/Ctrl_ins.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.h 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/Ctrl_ins.h 2007-11-17 17:59:58 UTC (rev 192) @@ -5,7 +5,9 @@ class CNoteMapWnd; class CCtrlInstruments; +using std::pair; + //=============================== class CNoteMapWnd: public CStatic //=============================== Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -7,7 +7,7 @@ #include "view_pat.h" #include "EffectVis.h" //rewbs.fxvis #include "ChannelManagerDlg.h" -#include "../soundlib/tuning_template.h" +#include "../soundlib/tuningbase.h" #include <string> using std::string; @@ -322,7 +322,7 @@ { if(pTuning) { - string noteStr = pTuning->GetNoteName(static_cast<CTuning::STEPTYPE>(note-NOTE_MIDDLEC)); + string noteStr = pTuning->GetNoteName(note-NOTE_MIDDLEC); noteStr.resize(3, ' '); DrawLetter(x, y, noteStr[0]); DrawLetter(x + pfnt->nNoteWidth/2, y, noteStr[1]); Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -19,6 +19,7 @@ //Init CommandSet and Load defaults activeCommandSet = new CCommandSet(); + CCommandSet::s_bShowErrorOnUnknownKeybinding = (CMainFrame::GetMainFrame()->GetPrivateProfileLong("Misc", "ShowErrorOnUnknownKeybinding", 1, theApp.GetConfigFileName()) != 0); CString workingDir; char wd[255]; Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -260,7 +260,7 @@ CAutoSaver *CMainFrame::m_pAutoSaver = NULL; //rewbs.autosave CPerformanceCounter *CMainFrame::m_pPerfCounter = NULL; -CString CMainFrame::m_csExecutablePath = ""; +CString CMainFrame::m_csExecutableDirectoryPath = ""; static UINT indicators[] = { @@ -278,16 +278,17 @@ CMainFrame::CMainFrame() //---------------------- { - char wd[255]; - _getdcwd(_getdrive(), wd, 255); - m_csExecutablePath = wd; //Assume working dir is executable path at this stage. + { + char path[_MAX_PATH]; + char exedrive[_MAX_DRIVE]; + char exedir[_MAX_DIR]; + GetModuleFileName(NULL, path, MAX_PATH); + _splitpath(path, exedrive, exedir, NULL, NULL); + memset(path, 0, sizeof(path)); + _makepath(path, exedrive, exedir, NULL, NULL); + m_csExecutableDirectoryPath = path; //path should end with \ + } - //Relabs.note: m_csExecutablePath doesn't give right path - //at least for debug builds. - #ifdef DEBUG - m_csExecutablePath += "\\bin"; - #endif - m_bModTreeHasFocus = false; //rewbs.customKeys m_pNoteMapHasFocus = NULL; //rewbs.customKeys m_bOptionsLocked = false; //rewbs.customKeys @@ -614,7 +615,6 @@ title += CString(" ") + GetFullVersionString(); SetTitle(title); OnUpdateFrameTitle(false); - // Load Chords theApp.LoadChords(Chords); @@ -664,6 +664,7 @@ delete m_pPerfCounter; CChannelManagerDlg::DestroySharedInstance(); + CSoundFile::DeleteStaticdata(); } int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) @@ -1903,7 +1904,7 @@ if (m_pSndFile) { //m_pSndFile->LoopPattern(-1); - //Relabs.note: Commented above line - why loop should be disabled when pausing? + //Commented above line - why loop should be disabled when pausing? m_pSndFile->m_dwSongFlags &= ~SONG_PAUSED; if (m_pSndFile == &m_WaveFile) { @@ -2939,3 +2940,4 @@ } } } + Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2007-11-17 17:59:58 UTC (rev 192) @@ -168,7 +168,7 @@ #define NUM_VUMETER_PENS 32 -// Pattern Setup +// Pattern Setup (contains also non-pattern related settings) #define PATTERN_PLAYNEWNOTE 0x01 #define PATTERN_LARGECOMMENTS 0x02 #define PATTERN_STDHIGHLIGHT 0x04 @@ -207,6 +207,7 @@ #define PATTERN_SYNCMUTE 0x1000000 #define PATTERN_AUTODELAY 0x2000000 + // Keyboard Setup enum { KEYBOARD_CUSTOM=0, @@ -356,7 +357,7 @@ CString m_csRegExt; CString m_csRegSettings; CString m_csRegWindow; - static CString m_csExecutablePath; + static CString m_csExecutableDirectoryPath; //To contain path of executable directory // Globals static UINT m_nLastOptionsPage, m_nFilterIndex; static BOOL gbMdiMaximize; Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -107,6 +107,7 @@ // -> DESC="channels management dlg" ReinitRecordState(); // -! NEW_FEATURE#0015 + m_ShowSavedialog = false; } @@ -342,10 +343,10 @@ case MOD_TYPE_DSM: case MOD_TYPE_AMF: case MOD_TYPE_PSM: - m_SndFile.m_nType = MOD_TYPE_S3M; + m_SndFile.ChangeModTypeTo(MOD_TYPE_S3M); break; default: - m_SndFile.m_nType = MOD_TYPE_IT; + m_SndFile.ChangeModTypeTo(MOD_TYPE_IT); } // -> CODE#0015 @@ -523,8 +524,9 @@ ErrorBox(IDS_ERR_SAVESONG, CMainFrame::GetMainFrame()); return FALSE; } - if ((!lpszPathName) || (!lpszPathName[0])) + if ((!lpszPathName) || (!lpszPathName[0]) || m_ShowSavedialog) { + m_ShowSavedialog = false; _splitpath(m_strPathName, drive, path, fname, NULL); if (!fname[0]) strcpy(fname, m_strTitle); strcpy(s, drive); @@ -1351,7 +1353,7 @@ // -> DESC="wav export update" UINT p = 0,n = 1; DWORD flags[MAX_BASECHANNELS]; - CHAR channel[MAX_CHANNELNAME+2]; + CHAR channel[MAX_CHANNELNAME+10]; // Channel mode : save song in multiple wav files (one for each enabled channels) if(wsdlg.m_bChannelMode){ @@ -1423,8 +1425,6 @@ if(!wsdlg.m_bChannelMode || !(flags[i] & CHN_MUTE)){ // rewbs.fix3239 m_SndFile.SetCurrentPos(0); - //Relabs.note: Since I removed pattern loop disabling from certain - //methods, making sure that pattern loop is off. m_SndFile.m_dwSongFlags &= ~SONG_PATTERNLOOP; if (wsdlg.m_bSelectPlay) { m_SndFile.SetCurrentOrder(wsdlg.m_nMinOrder); @@ -1628,7 +1628,6 @@ } END_CRITICAL(); //m_SndFile.m_dwSongFlags &= ~(SONG_STEP|SONG_PAUSED); - //Relabs.note: Added SONG_PATTERNLOOP. m_SndFile.m_dwSongFlags &= ~(SONG_STEP|SONG_PAUSED|SONG_PATTERNLOOP); pMainFrm->PlayMod(this, m_hWndFollow, m_dwNotifyType); } @@ -1705,7 +1704,6 @@ pMainFrm->PauseMod(); //m_SndFile.m_dwSongFlags &= ~SONG_STEP; - //Relabs.hack: Added SONG_PATTERNLOOP m_SndFile.m_dwSongFlags &= ~(SONG_STEP|SONG_PATTERNLOOP); m_SndFile.SetCurrentPos(0); pMainFrm->ResetElapsedTime(); @@ -3013,29 +3011,37 @@ void CModDoc::ChangeFileExtension(UINT nNewType) //---------------------------------------------- { - CHAR path[_MAX_PATH], drive[_MAX_PATH], fname[_MAX_FNAME]; - _splitpath(GetPathName(), drive, path, fname, NULL); + //Not making path if path is empty(case only(?) for new file) + if(GetPathName().GetLength() > 0) + { + CHAR path[_MAX_PATH], drive[_MAX_PATH], fname[_MAX_FNAME]; + _splitpath(GetPathName(), drive, path, fname, NULL); - CString newPath = drive; - newPath += path; + CString newPath = drive; + newPath += path; - //Catch case where we don't have a filename yet. - if (fname[0] == 0) { - newPath += GetTitle(); - } else { - newPath += fname; + //Catch case where we don't have a filename yet. + if (fname[0] == 0) { + newPath += GetTitle(); + } else { + newPath += fname; + } + + switch(nNewType) + { + case MOD_TYPE_XM: newPath += ".xm"; break; + case MOD_TYPE_IT: m_SndFile.m_dwSongFlags & SONG_ITPROJECT ? newPath+=".itp" : newPath+=".it"; break; + case MOD_TYPE_MPT: newPath += ".mptm"; break; + case MOD_TYPE_S3M: newPath += ".s3m"; break; + case MOD_TYPE_MOD: newPath += ".mod"; break; + default: ASSERT(false); + } + SetPathName(newPath, FALSE); + if(GetSoundFile() && GetSoundFile()->GetType() != nNewType) m_ShowSavedialog = true; + //Forcing savedialog to appear after extension change - otherwise + //unnotified file overwriting may occur. } - switch(nNewType) - { - case MOD_TYPE_XM: newPath += ".xm"; break; - case MOD_TYPE_IT: m_SndFile.m_dwSongFlags & SONG_ITPROJECT ? newPath+=".itp" : newPath+=".it"; break; - case MOD_TYPE_MPT: newPath += ".mptm"; break; - case MOD_TYPE_S3M: newPath += ".s3m"; break; - case MOD_TYPE_MOD: newPath += ".mod"; break; - default: ASSERT(false); - } - SetPathName(newPath, FALSE); UpdateAllViews(NULL, HINT_MODTYPE); } @@ -3090,7 +3096,6 @@ CString message; message.Format("Param %d can already be controlled with macro %X", paramToUse, checkMacro); CMainFrame::GetMainFrame()->MessageBox(message, "Macro exists for this param",MB_ICONINFORMATION | MB_OK); - //Relabs.expl: Modified to prevent notification box go 'under' ompt to block key messages. return; } } Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/Moddoc.h 2007-11-17 17:59:58 UTC (rev 192) @@ -89,6 +89,8 @@ DWORD m_dwNotifyType; PATTERNUNDOBUFFER PatternUndo[MAX_UNDO_LEVEL]; + bool m_ShowSavedialog; + // -> CODE#0015 // -> DESC="channels management dlg" BYTE MultiRecordMask[(MAX_CHANNELS+7)/8]; Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -1389,10 +1389,6 @@ BOOL CModDoc::ExpandPattern(UINT nPattern) //---------------------------------------- { - - MODCOMMAND *newPattern, *oldPattern; - UINT nRows, nChns; - // -> CODE#0008 // -> DESC="#define to set pattern size" Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -189,7 +189,28 @@ //0,/*rewbs.smoothVST*/ ,0/*rewbs.velocity*/, }; +static void ShowChangesDialog() +//----------------------------- +{ + CString firstOpenMessage = "OpenMPT version " + CMainFrame::GetFullVersionString(); + firstOpenMessage += ". This is a development build primarily aimed for testing.\n\nChanges:\n\n" + "[New] Windows keys can be used as modifiers in the keyboard configuration(disables Windows start menu pop-up if used in the active keyboard configuration).\n" + "[New] Name filter in plugin selection dialog.\n" + "[Imp] Improved preset navigation in VST window.\n" + "[Imp] Improvements in IT compatible play.\n" + "[Imp] Improvements in user defined tuning modes.\n" + "[Fix] Fixed possible unnotified file overwriting when saving unsaved file.\n" + "[Fix] Fixed wrong version number in IT files saved with compatibility save.\n" + "[Fix] Fixed broken note preview for certain type of instruments in instrument tab.\n" + "[Fix] Fixed possible crash when exporting wav in channel mode with long channel name.\n" + "[Fix] Fixed channel position jump when clicking VST box in channel header.\n" + "[Fix] Fixed possible searching of wrong parameter in pattern search.\n" + "[Misc] Update check disabled and miscellaneous other changes."; + CMainFrame::GetMainFrame()->MessageBox(firstOpenMessage, "OpenMPT v." + CMainFrame::GetFullVersionString(), MB_ICONINFORMATION); +} + + ///////////////////////////////////////////////////////////////////////////// // MPTRACK Command Line options @@ -424,6 +445,7 @@ } void CTrackApp::LoadRegistryDLS() +//------------------------------- { CHAR szFileNameX[_MAX_PATH]; HKEY keyX; @@ -649,6 +671,7 @@ m_szConfigFileName[0] = 0; m_szStringsFileName[0] = 0; + if (GetModuleFileName(NULL, m_szConfigFileName, sizeof(m_szConfigFileName))) { CHAR szDrive[_MAX_DRIVE]="", szDir[_MAX_PATH]=""; @@ -786,6 +809,7 @@ m_dwTimeStarted = timeGetTime(); m_bInitialized = TRUE; + /* if (CMainFrame::gnCheckForUpdates) { try { UpdateCheck(); @@ -795,10 +819,12 @@ // we will end up here if the dll cannot be foung (e.g. on win98). } } + */ - // Open settings if this is the previous execution was with an earlier version. + // Open settings if the previous execution was with an earlier version. if (!cmdInfo.m_bNoSettingsOnNewVersion && CMainFrame::gcsPreviousVersion < CMainFrame::GetFullVersionString()) { StopSplashScreen(); + ShowChangesDialog(); m_pMainWnd->PostMessage(WM_COMMAND, ID_VIEW_OPTIONS); } @@ -1576,12 +1602,12 @@ m_bmp.LoadBitmap(MAKEINTRESOURCE(IDB_MPTRACK)); wsprintf(s, "Build Date: %s", gszBuildDate); SetDlgItemText(IDC_EDIT2, s); - SetDlgItemText(IDC_EDIT3, CString("Open Modplug Tracker, version ") + CMainFrame::GetFullVersionString()); + SetDlgItemText(IDC_EDIT3, CString("Open Modplug Tracker, version ") + CMainFrame::GetFullVersionString() + " (development build)"); m_heContact.SetWindowText( "Contact / Discussion:\r\n\ http://modplug.sourceforge.net/forum\r\n\ -\r\n\Updates:\r\n\ +\r\nUpdates:\r\n\ http://modplug.sourceforge.net/builds/#dev"); char *pArrCredit = { @@ -1591,7 +1617,7 @@ "|" "Contributors:|" "Robin Fernandes: ro...@so... (2004-2007)|" - "Ahti Leppan: rel...@us... (2005-2007)|" + "Ahti Lepp\xE4nen: aa...@dn... (2005-2007)|" "Sergiy Pylypenko: x.p...@gm... (2007)|" "Eric Chavanon: co...@er... (2004-2005)|" "Trevor Nunes: mo...@pl... (2004)|" @@ -1635,6 +1661,7 @@ //-------------------------- { if (gpAboutDlg) return; + ShowChangesDialog(); gpAboutDlg = new CAboutDlg(); gpAboutDlg->Create(IDD_ABOUTBOX, m_pMainWnd); } @@ -2960,6 +2987,7 @@ //rewbs.crashHandler LRESULT CTrackApp::ProcessWndProcException(CException* e, const MSG* pMsg) +//----------------------------------------------------------------------- { // TODO: Add your specialized code here and/or call the base class Log("Unhandled Exception\n"); Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/Mptrack.h 2007-11-17 17:59:58 UTC (rev 192) @@ -15,6 +15,7 @@ #include "resource.h" // main symbols #include "sndfile.h" #include <windows.h> +#include <Specstrings.h> // In VC2003, '__in' was undefined in winhttp.h #include <winhttp.h> class CModDoc; Modified: trunk/OpenMPT/mptrack/OrderToPatternTable.cpp =================================================================== --- trunk/OpenMPT/mptrack/OrderToPatternTable.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/OrderToPatternTable.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -9,7 +9,7 @@ { if(memLength < sizeof(s_Version) + sizeof(size_t)) return 0; WORD version = 0; - size_t s = 0; + uint32 s = 0; DWORD memPos = 0; memcpy(&version, src, sizeof(version)); memPos += sizeof(version); @@ -55,7 +55,7 @@ //Version fwrite(&s_Version, sizeof(s_Version), 1, f); - const size_t s = size(); + const uint32 s = size(); //Size fwrite(&s, sizeof(s), 1, f); //Values Modified: trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/ScaleEnvPointsDlg.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -42,7 +42,7 @@ { char buffer[10]; GetDlgItemText(IDC_EDIT_FACTOR, buffer, 9); - float factor = static_cast<float>(atof(buffer)); + float factor = ConvertStrTo<float>(buffer); if(factor > 0) { WORD (*array)[MAX_ENVPOINTS] = NULL; @@ -69,7 +69,7 @@ { for(UINT i = 0; i<*arraySize; i++) { - (*array)[i] *= factor; + (*array)[i] = static_cast<WORD>(factor * (*array)[i]); //Checking that the order of points is preserved. if(i > 0 && (*array)[i] <= (*array)[i-1]) Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -5,13 +5,23 @@ #include "misc_util.h" #include ".\tuningdialog.h" -const string CTuningDialog::s_stringTypeGEN = "General"; -const string CTuningDialog::s_stringTypeRP = "Ratio periodic"; -const string CTuningDialog::s_stringTypeTET = "TET"; - const CTuningDialog::TUNINGTREEITEM CTuningDialog::s_notFoundItemTuning = TUNINGTREEITEM(); const HTREEITEM CTuningDialog::s_notFoundItemTree = NULL; +using CTuning::UNOTEINDEXTYPE; +using CTuning::RATIOTYPE; +#define TT_GENERAL CTuning::TT_GENERAL +#define TT_GROUPGEOMETRIC CTuning::TT_GROUPGEOMETRIC +#define TT_GEOMETRIC CTuning::TT_GEOMETRIC +#define EM_CONST CTuning::EM_CONST +#define EM_CONST_STRICT CTuning::EM_CONST_STRICT +#define TUNINGTYPE CTuning::TUNINGTYPE +#define NOTEINDEXTYPE CTuning::NOTEINDEXTYPE +#define EM_ALLOWALL CTuning::EM_ALLOWALL + +using namespace std; + + /* TODOS: -Clear tuning @@ -144,9 +154,11 @@ //-------------------------------- { CDialog::OnInitDialog(); - + m_RatioMapWnd.Init(this, 0); + SetDlgItemText(IDC_TUNINGTYPE_DESC, ""); + //-->Creating treeview m_TreeItemTuningItemMap.ClearMapping(); for(size_t i = 0; i<m_TuningCollections.size(); i++) @@ -158,9 +170,9 @@ m_pActiveTuningCollection = GetpTuningCollection(m_pActiveTuning); //Adding tuning type names to corresponding combobox. - m_CombobTuningType.AddString(s_stringTypeGEN.c_str()); - m_CombobTuningType.AddString(s_stringTypeRP.c_str()); - m_CombobTuningType.AddString(s_stringTypeTET.c_str()); + m_CombobTuningType.AddString(CTuning::s_TuningTypeStrGeneral); + m_CombobTuningType.AddString(CTuning::s_TuningTypeStrGroupGeometric); + m_CombobTuningType.AddString(CTuning::s_TuningTypeStrGeometric); m_ButtonSet.EnableWindow(FALSE); @@ -169,8 +181,11 @@ m_EditTuningCollectionEditMask.ShowWindow(SW_SHOW); //#endif + m_EditSteps.SetLimitText(2); m_EditFineTuneSteps.SetLimitText(3); + if(m_pActiveTuning) m_RatioMapWnd.m_nNote = m_RatioMapWnd.m_nNoteCentre + m_pActiveTuning->GetValidityRange().first + (m_pActiveTuning->GetValidityRange().second - m_pActiveTuning->GetValidityRange().first)/2 + 1; + UpdateView(); return TRUE; @@ -245,15 +260,16 @@ m_RatioMapWnd.Invalidate(); UpdateRatioMapEdits(m_RatioMapWnd.GetShownCentre()); - const CTuning::STEPTYPE period = m_pActiveTuning->GetPeriod(); - const CTuning::RATIOTYPE periodRatio = m_pActiveTuning->GetPeriodRatio(); + + const UNOTEINDEXTYPE period = m_pActiveTuning->GetGroupSize(); + const RATIOTYPE GroupRatio = m_pActiveTuning->GetGroupRatio(); if(period > 0) { m_EditSteps.EnableWindow(); m_EditSteps.SetWindowText(Stringify(period).c_str()); m_EditRatioPeriod.EnableWindow(); - m_EditRatioPeriod.SetWindowText(Stringify(periodRatio).c_str()); + m_EditRatioPeriod.SetWindowText(Stringify(GroupRatio).c_str()); } else //case: m_pActiveTuning is of type general. { @@ -266,11 +282,11 @@ bool enableControls = true; - if(m_pActiveTuning->GetEditMask() == CTuning::EM_CONST || - m_pActiveTuning->GetEditMask() == CTuning::EM_CONST_STRICT) + if(m_pActiveTuning->GetEditMask() == EM_CONST || + m_pActiveTuning->GetEditMask() == EM_CONST_STRICT) { CheckDlgButton(IDC_CHECK_READONLY, MF_CHECKED); - if(m_pActiveTuning->GetEditMask() == CTuning::EM_CONST_STRICT) + if(m_pActiveTuning->GetEditMask() == EM_CONST_STRICT) m_ButtonReadOnly.EnableWindow(FALSE); else m_ButtonReadOnly.EnableWindow(TRUE); @@ -315,6 +331,8 @@ m_EditFineTuneSteps.SetWindowText(""); m_EditName.SetWindowText(""); + SetDlgItemText(IDC_TUNINGTYPE_DESC, ""); + m_CombobTuningType.SetCurSel(-1); m_ButtonReadOnly.EnableWindow(FALSE); @@ -407,81 +425,78 @@ { if(m_CombobTuningType.GetCount() < 3) m_DoErrorExit = true; - if(m_pActiveTuning->GetTuningType() == CTuning::TT_TET) + if(m_pActiveTuning->GetTuningType() == TT_GEOMETRIC) m_CombobTuningType.SetCurSel(2); else - if(m_pActiveTuning->GetTuningType() == CTuning::TT_RATIOPERIODIC) + if(m_pActiveTuning->GetTuningType() == TT_GROUPGEOMETRIC) m_CombobTuningType.SetCurSel(1); else m_CombobTuningType.SetCurSel(0); } + UpdateTuningDescription(); } -CTuning::CTUNINGTYPE CTuningDialog::GetTuningTypeFromStr(const string& str) const +TUNINGTYPE CTuningDialog::GetTuningTypeFromStr(const string& str) const //-------------------------------------------------------------------------------- { - if(str == s_stringTypeTET) - return CTuning::TT_TET; - if(str == s_stringTypeRP) - return CTuning::TT_RATIOPERIODIC; - return CTuning::TT_GENERAL; + return CTuning::GetTuningType(str.c_str()); } void CTuningDialog::OnCbnSelchangeComboTtype() //-------------------------------------------- { - if(m_pActiveTuning == NULL) - return; - - - const CTuning::CTUNINGTYPE oldType = m_pActiveTuning->GetTuningType(); - const size_t BS = 20; - char buffer[BS]; - m_CombobTuningType.GetWindowText(buffer, BS); - const string strNewType = buffer; - CTuning::CTUNINGTYPE newType = GetTuningTypeFromStr(strNewType); - if(!m_pActiveTuning->DoesTypeInclude(newType)) + if(m_pActiveTuning != NULL) { - if(MessageBox("This will change the ratio values; continue?", 0, MB_YESNO) == IDYES) + const TUNINGTYPE oldType = m_pActiveTuning->GetTuningType(); + const size_t BS = 20; + char buffer[BS]; + m_CombobTuningType.GetWindowText(buffer, BS); + const string strNewType = buffer; + TUNINGTYPE newType = GetTuningTypeFromStr(strNewType); + if(!m_pActiveTuning->IsOfType(newType)) { - m_ModifiedTCs[GetpTuningCollection(m_pActiveTuning)] = true; + if(MessageBox("This action may change the ratio values; continue?", 0, MB_YESNO) == IDYES) + { + m_ModifiedTCs[GetpTuningCollection(m_pActiveTuning)] = true; - const size_t BS = 20; - char buffer[BS]; - m_EditSteps.GetWindowText(buffer, BS); - CTuning::STEPTYPE steps = static_cast<CTuning::STEPTYPE>(atoi(buffer)); + const size_t BS = 20; + char buffer[BS]; + m_EditSteps.GetWindowText(buffer, BS); + NOTEINDEXTYPE steps = ConvertStrTo<NOTEINDEXTYPE>(buffer); - m_EditRatioPeriod.GetWindowText(buffer, BS); - CTuning::RATIOTYPE pr = static_cast<CTuning::RATIOTYPE>(atof(buffer)); + m_EditRatioPeriod.GetWindowText(buffer, BS); + RATIOTYPE pr = ConvertStrTo<RATIOTYPE>(buffer); - if(steps <= 0) - steps = 1; - if(pr <= 0) - pr = 1; + if(steps <= 0) + steps = 1; + if(pr <= 0) + pr = 1; - if(newType == CTuning::TT_RATIOPERIODIC) - m_pActiveTuning->CreateRatioPeriodic(steps, pr); - else - if(newType == CTuning::TT_TET) - m_pActiveTuning->CreateTET(steps, pr); - - UpdateView(UM_TUNINGDATA); - } - else //Not wanting to discard current values. - { - //Restoring tuning type combobox. - if(oldType == CTuning::TT_TET) - m_CombobTuningType.SetCurSel(2); - else + if(newType == TT_GROUPGEOMETRIC) + m_pActiveTuning->CreateGroupGeometric(steps, pr, 0); + else + if(newType == TT_GEOMETRIC) + m_pActiveTuning->CreateGeometric(steps, pr); + + UpdateView(UM_TUNINGDATA); + } + else //Not wanting to discard current values. { - if(oldType == CTuning::TT_RATIOPERIODIC) - m_CombobTuningType.SetCurSel(1); - else - m_CombobTuningType.SetCurSel(0); + //Restoring tuning type combobox. + if(oldType == TT_GEOMETRIC) + m_CombobTuningType.SetCurSel(2); + else + { + if(oldType == TT_GROUPGEOMETRIC) + m_CombobTuningType.SetCurSel(1); + else + m_CombobTuningType.SetCurSel(0); + } } } } + UpdateTuningDescription(); } @@ -509,7 +524,7 @@ if(!m_pActiveTuning) return; - const CTuning::STEPTYPE currentNote = m_RatioMapWnd.GetShownCentre(); + const NOTEINDEXTYPE currentNote = m_RatioMapWnd.GetShownCentre(); const size_t BS = 5; char buffer[BS]; m_EditNotename.GetWindowText(buffer, BS); @@ -541,7 +556,7 @@ if(!m_pActiveTuning) return; - const CTuning::STEPTYPE currentNote = m_RatioMapWnd.GetShownCentre(); + const NOTEINDEXTYPE currentNote = m_RatioMapWnd.GetShownCentre(); const size_t BS = 12; char buffer[BS]; @@ -549,7 +564,7 @@ string str = buffer; if(str.length() > 0) { - m_pActiveTuning->SetRatio(currentNote, static_cast<CTuning::RATIOTYPE>(atof(buffer))); + m_pActiveTuning->SetRatio(currentNote, ConvertStrTo<RATIOTYPE>(buffer)); m_ModifiedTCs[GetpTuningCollection(m_pActiveTuning)] = true; UpdateTuningType(); m_RatioMapWnd.Invalidate(); @@ -568,21 +583,21 @@ const size_t BS = 20; char buffer[BS]; m_EditMiscActions.GetWindowText(buffer, BS); - m_pActiveTuning->Multiply(static_cast<CTuning::RATIOTYPE>(atof(buffer))); + m_pActiveTuning->Multiply(ConvertStrTo<RATIOTYPE>(buffer)); m_ModifiedTCs[GetpTuningCollection(m_pActiveTuning)] = true; m_EditMiscActions.SetWindowText(""); m_RatioMapWnd.Invalidate(); } } -void CTuningDialog::UpdateRatioMapEdits(const CTuning::STEPTYPE& note) +void CTuningDialog::UpdateRatioMapEdits(const NOTEINDEXTYPE& note) //----------------------------------------------------------- { if(m_pActiveTuning == NULL) return; m_RatioEditApply = false; - m_EditRatio.SetWindowText(Stringify(m_pActiveTuning->GetFrequencyRatio(note)).c_str()); + m_EditRatio.SetWindowText(Stringify(m_pActiveTuning->GetRatio(note)).c_str()); m_NoteEditApply = false; m_EditNotename.SetWindowText(m_pActiveTuning->GetNoteName(note).c_str()); @@ -625,12 +640,12 @@ if(ext == CTuning::s_FileExtension) { if(pT != NULL) - failure = pT->SerializeBinary(fout); + failure = pT->Serialize(fout); } else //Case: Saving tuning collection. if(ext == CTuningCollection::s_FileExtension) if(pTC != NULL) - failure = pTC->SerializeBinary(fout); + failure = pTC->Serialize(fout); fout.close(); EndWaitCursor(); @@ -663,13 +678,12 @@ if(ext == CTuning::s_FileExtension) { ifstream fin(dlg.GetPathName(), ios::binary); - CTuning* pT = new CTuningRTI; - failure = pT->UnSerializeBinary(fin); + CTuning* pT = CTuningRTI::UnserializeOLD(fin); + if(pT == 0) {fin.clear(); fin.seekg(0); pT = CTuning::Unserialize(fin);} fin.close(); - if(failure) - delete pT; - else + if(pT) { + failure = false; m_TempTunings.AddTuning(pT); m_pActiveTuning = pT; @@ -686,7 +700,7 @@ //directly replace some collection. CTuningCollection* pNewTCol = new CTuningCollection; pNewTCol->SetSavefilePath(static_cast<LPCTSTR>(dlg.GetPathName())); - failure = pNewTCol->UnSerializeBinary(); + failure = pNewTCol->Unserialize(); if(failure) { delete pNewTCol; pNewTCol = 0; @@ -702,10 +716,8 @@ } } - - if(failure) - ErrorBox(IDS_ERR_FILEOPEN, this); + ErrorBox(IDS_OPERATION_FAIL, this); } void CTuningDialog::OnEnChangeEditFinetunesteps() @@ -722,7 +734,7 @@ const BYTE BS = 5; char buffer[BS]; m_EditFineTuneSteps.GetWindowText(buffer, BS); - m_EditFineTuneSteps.SetWindowText(Stringify(m_pActiveTuning->SetFineStepCount(static_cast<CTuning::FINESTEPTYPE>(atoi(buffer)))).c_str()); + m_EditFineTuneSteps.SetWindowText(Stringify(m_pActiveTuning->SetFineStepCount(ConvertStrTo<CTuning::USTEPINDEXTYPE>(buffer))).c_str()); m_ModifiedTCs[GetpTuningCollection(m_pActiveTuning)] = true; m_EditFineTuneSteps.Invalidate(); } @@ -737,14 +749,14 @@ if(IsDlgButtonChecked(IDC_CHECK_READONLY)) { - if(m_pActiveTuning->SetEditMask(CTuning::EM_CONST)) + if(m_pActiveTuning->SetEditMask(EM_CONST)) CheckDlgButton(IDC_CHECK_READONLY, MF_UNCHECKED); else UpdateView(UM_TUNINGDATA); } else { - if(m_pActiveTuning->SetEditMask(CTuning::EM_ALLOWALL)) + if(m_pActiveTuning->SetEditMask(EM_ALLOWALL)) CheckDlgButton(IDC_CHECK_READONLY, MF_CHECKED); else UpdateView(UM_TUNINGDATA); @@ -777,7 +789,7 @@ const size_t BS = 20; char buffer[BS]; m_EditSteps.GetWindowText(buffer, BS); - m_pActiveTuning->ChangePeriod(static_cast<CTuning::STEPTYPE>(atoi(buffer))); + m_pActiveTuning->ChangeGroupsize(ConvertStrTo<UNOTEINDEXTYPE>(buffer)); m_ModifiedTCs[GetpTuningCollection(m_pActiveTuning)] = true; UpdateView(UM_TUNINGDATA); } @@ -792,7 +804,7 @@ const size_t BS = 20; char buffer[BS]; m_EditRatioPeriod.GetWindowText(buffer, BS); - m_pActiveTuning->ChangePeriodRatio(static_cast<CTuning::RATIOTYPE>(atof(buffer))); + m_pActiveTuning->ChangeGroupRatio(ConvertStrTo<RATIOTYPE>(buffer)); m_ModifiedTCs[GetpTuningCollection(m_pActiveTuning)] = true; UpdateView(UM_TUNINGDATA); } @@ -847,7 +859,7 @@ CTuningCollection& rCurTCol = *m_TuningCollections.at(i); for(size_t j = 0; j<rCurTCol.GetNumTunings(); j++) { - if(pT == &rCurTCol.GetTuning(static_cast<unsigned short>(j))) + if(pT == &rCurTCol.GetTuning(j)) { return &rCurTCol; } @@ -863,7 +875,7 @@ //This methods gets called when selected item in the treeview //changes. - //TODO: This gets called before killfocus messages of edits, this + //TODO: This gets called before killfocus messages of edits, which // can be a problem. LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR); @@ -903,7 +915,6 @@ //---------------------------------------------------------------------------- { LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR); - // TODO: Add your control notification handler code here *pResult = 0; if(pNMTreeView->itemOld.mask & TVIF_HANDLE && pNMTreeView->itemOld.hItem) { @@ -1243,7 +1254,7 @@ if(!m_pActiveTuningCollection) return; - if(m_pActiveTuningCollection->SerializeBinary()) + if(m_pActiveTuningCollection->Serialize()) { MsgBox(IDS_OPERATION_FAIL, this, NULL, MB_ICONINFORMATION); } @@ -1254,7 +1265,33 @@ } } +void CTuningDialog::UpdateTuningDescription() +//------------------------------------------- +{ + switch(m_CombobTuningType.GetCurSel()) + { + case 0: + SetDlgItemText(IDC_TUNINGTYPE_DESC, CTuning::GetTuningTypeDescription(TT_GENERAL)); + break; + case 1: + SetDlgItemText(IDC_TUNINGTYPE_DESC, CTuning::GetTuningTypeDescription(TT_GROUPGEOMETRIC)); + break; + + case 2: + SetDlgItemText(IDC_TUNINGTYPE_DESC, CTuning::GetTuningTypeDescription(TT_GEOMETRIC)); + break; + + default: + if(m_pActiveTuning) + SetDlgItemText(IDC_TUNINGTYPE_DESC, m_pActiveTuning->GetTuningTypeDescription()); + else + SetDlgItemText(IDC_TUNINGTYPE_DESC, "Unknown type"); + break; + } +} + + //////////////////////////////////////////////////////// //*************** //CTuningTreeCtrl Modified: trunk/OpenMPT/mptrack/TuningDialog.h =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.h 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/TuningDialog.h 2007-11-17 17:59:58 UTC (rev 192) @@ -42,7 +42,7 @@ void RemoveValue_1(const T1& a) { - vector<T1>::iterator iter = find(m_T1.begin(), m_T1.end(), a); + typename vector<T1>::iterator iter = find(m_T1.begin(), m_T1.end(), a); if(iter != m_T1.end()) { m_T2.erase(m_T2.begin() + (iter-m_T1.begin())); @@ -52,7 +52,7 @@ void RemoveValue_2(const T2& b) { - vector<T2>::iterator iter = find(m_T2.begin(), m_T2.end(), b); + typename vector<T2>::iterator iter = find(m_T2.begin(), m_T2.end(), b); if(iter != m_T2.end()) { m_T1.erase(m_T1.begin() + (iter-m_T2.begin())); @@ -62,7 +62,7 @@ T2 GetMapping_12(const T1& a) const { - vector<T1>::const_iterator iter = find(m_T1.begin(), m_T1.end(), a); + typename vector<T1>::const_iterator iter = find(m_T1.begin(), m_T1.end(), a); if(iter != m_T1.end()) { return m_T2[iter-m_T1.begin()]; @@ -73,7 +73,7 @@ T1 GetMapping_21(const T2& b) const { - vector<T2>::const_iterator iter = find(m_T2.begin(), m_T2.end(), b); + typename vector<T2>::const_iterator iter = find(m_T2.begin(), m_T2.end(), b); if(iter != m_T2.end()) { return m_T1[iter-m_T2.begin()]; @@ -102,8 +102,7 @@ CTuningDialog& m_rParentDialog; public: CTuningTreeCtrl(CTuningDialog* parent) : m_rParentDialog(*parent) {} - //Note: Parent address may be given in initialiser list so - //do not use it. + //Note: Parent address may be given in its initializer list. void SetDragging(bool state = true) {m_Dragging = state;} bool IsDragging() {return m_Dragging;} @@ -198,7 +197,7 @@ BOOL OnInitDialog(); void AddTuningCollection(CTuningCollection* pTC) {if(pTC) m_TuningCollections.push_back(pTC);} - void UpdateRatioMapEdits(const CTuning::STEPTYPE&); + void UpdateRatioMapEdits(const CTuning::NOTEINDEXTYPE&); bool GetModifiedStatus(const CTuningCollection* const pTc) const; @@ -209,8 +208,10 @@ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support private: - CTuning::CTUNINGTYPE GetTuningTypeFromStr(const string& str) const; + CTuning::TUNINGTYPE GetTuningTypeFromStr(const string& str) const; + void UpdateTuningDescription(); + void UpdateView(const int UpdateMask = 0); void UpdateTuningType(); @@ -222,16 +223,17 @@ void OnEndDrag(HTREEITEM dragDestItem); - CTuningCollection* GetpTuningCollection(const CTuning* const) const; //Returns pointer to the tuning collection where tuning given as argument //belongs to. - - CTuningCollection* GetpTuningCollection(HTREEITEM ti) const; + CTuningCollection* GetpTuningCollection(const CTuning* const) const; + //Returns the address of corresponding tuningcollection; if it points //to tuning-entry, returning the owning tuningcollection - - bool IsDeletable(const CTuningCollection* const pTC) const; + CTuningCollection* GetpTuningCollection(HTREEITEM ti) const; + //Checks whether tuning collection can be deleted. + bool IsDeletable(const CTuningCollection* const pTC) const; + private: CTuningRatioMapWnd m_RatioMapWnd; @@ -273,10 +275,6 @@ CTuningTreeCtrl m_TreeCtrlTuning; private: - static const string s_stringTypeGEN; - static const string s_stringTypeRP; - static const string s_stringTypeTET; - typedef CTuningTreeItem TUNINGTREEITEM; typedef CBijectiveMap<HTREEITEM, TUNINGTREEITEM> TREETUNING_MAP; TREETUNING_MAP m_TreeItemTuningItemMap; @@ -299,13 +297,14 @@ TT_TUNING }; + + //To indicate whether to apply changes made to + //those edit boxes(they are modified by certain activities + //in case which the modifications should not be applied to + //tuning data. bool m_NoteEditApply; bool m_RatioEditApply; - //To indicate whether to apply changes made to - //to those edit boxes(they are modified by non-user - //activies and in these cases the value should be applied - //to the tuning data. - + enum { UM_TUNINGDATA = 1, //UM <-> Update Mask @@ -317,9 +316,9 @@ bool AddTuning(CTuningCollection*, CTuning* pT = NULL); - bool m_DoErrorExit; //Flag to prevent multiple exit error-messages. - + bool m_DoErrorExit; + void DoErrorExit(); Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -965,6 +965,7 @@ if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME))) { memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME); + pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFile->ChnSettings[nChn].szName)-1] = 0; pModDoc->SetModified(); pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); } @@ -989,6 +990,7 @@ if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME))) { memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME); + pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFile->ChnSettings[nChn].szName)-1] = 0; pModDoc->SetModified(); pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); } @@ -1013,6 +1015,7 @@ if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME))) { memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME); + pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFile->ChnSettings[nChn].szName)-1] = 0; pModDoc->SetModified(); pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); } @@ -1037,6 +1040,7 @@ if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME))) { memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME); + pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFile->ChnSettings[nChn].szName)-1] = 0; pModDoc->SetModified(); pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); } Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2007-07-11 20:36:02 UTC (rev 191) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2007-11-17 17:59:58 UTC (rev 192) @@ -2361,7 +2361,7 @@ { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CModDoc *pModDoc = GetDocument(); - if ((pModDoc) && (pMainFrm) && (note<128)) + if ((pModDoc) && (pMainFrm) && (note > 0) && (note<128)) { CHAR s[64]; const size_t sizeofS = sizeof(s) / sizeof(s[0]); @@ -2387,13 +2387,13 @@ } */ INSTRUMENTHEADER *penv = pModDoc->GetSoundFile()->Headers[m_nInstrument]; - if ((!penv) || (!penv->Keyboard[note])) return; + if ((!penv) || (!penv->Keyboard[note-1] && !penv->nMixPlug)) return; m_baPlayingNote[note] = true; //rewbs.instViewNNA m_nPlayingChannel= pModDoc->PlayNote(note, m_nInstrument, 0, FALSE); //rewbs.instViewNNA s[0] = 0; if ((note) && (note <= 120)) { - const string temp = pModDoc->GetSoundFile()->GetNoteName(static_cast<CTuning::STEPTYPE>(note), m_nInstrument); + const string temp = pModDoc->GetSoundFile()->GetNoteName(note, m_nInstrument); ... [truncated message content] |
From: <Rel...@us...> - 2007-11-17 20:42:43
|
Revision: 194 http://modplug.svn.sourceforge.net/modplug/?rev=194&view=rev Author: Relabsoluness Date: 2007-11-17 12:42:39 -0800 (Sat, 17 Nov 2007) Log Message: ----------- 1.17.02.49 Modified Paths: -------------- trunk/OpenMPT/mptrack/bin/mptrack.exe trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/bin/mptrack.exe =================================================================== (Binary files differ) Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2007-11-17 18:31:14 UTC (rev 193) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2007-11-17 20:42:39 UTC (rev 194) @@ -425,6 +425,22 @@ //Playback behavior change for MPT: Don't change sample if it is in the same instrument as previous sample. if(bPorta && bNewTuning && penv == pChn->pHeader) return; + + bool returnAfterVolumeAdjust = false; + // bInstrumentChanged is used for IT carry-on env option + if (penv != pChn->pHeader) + { + bInstrumentChanged = TRUE; + pChn->pHeader = penv; + } else + // Special XM hack + if ((bPorta) && (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) && (penv) + && (pChn->pInstrument) && (psmp != pChn->pInstrument)) + { + // FT2 doesn't change the sample in this case, + // but still uses the sample info from the old one (bug?) + returnAfterVolumeAdjust = true; + } // Update Volume if (bUpdVol) @@ -437,23 +453,11 @@ if(penv && penv->nMixPlug) pChn->nVolume = pChn->GetVSTVolume(); } - } - // bInstrumentChanged is used for IT carry-on env option - if (penv != pChn->pHeader) - { - bInstrumentChanged = TRUE; - pChn->pHeader = penv; - } else - // Special XM hack - if ((bPorta) && (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) && (penv) - && (pChn->pInstrument) && (psmp != pChn->pInstrument)) - { - // FT2 doesn't change the sample in this case, - // but still uses the sample info from the old one (bug?) - return; - } + if(returnAfterVolumeAdjust) return; + + // Instrument adjust pChn->nNewIns = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Rel...@us...> - 2008-01-12 16:49:54
|
Revision: 195 http://modplug.svn.sourceforge.net/modplug/?rev=195&view=rev Author: Relabsoluness Date: 2008-01-12 08:49:50 -0800 (Sat, 12 Jan 2008) Log Message: ----------- + MIDI controller mapping to plug params. + Ability to take MIDI volume into account when playing notes. + Ability to pass MIDI to plug. + Ability to start/continue/stop play with certain MIDI messages (untested) + Ability to choose how volume commands behave for plugs. . Fixed sending wrong MIDI message in ::MidiCC. + Keyshortcuts for preset navigation jumps in VST editor. . Default VST editor preset field name validation in the menubar. + Added ability to edit various flags in song properties. . Fix for pattern duplicate for small patterns (http://lpchip.com/modplug/viewtopic.php?t=1747) . Fixed song properties-menu entry in mainframe(was grayed and didn't show keyshortcut) . Fixed crash with certain toolbar related ini-settings (http://lpchip.com/modplug/viewtopic.php?t=2033) . Further fixes to prevent unnotified overwriting of file. / .bak-files won't now be shown with "All modules" filter when loading modules. . Show row playtime didn't on certain cases work on first pattern row (http://lpchip.com/modplug/viewtopic.php?t=2044) . Fix to faulty play with certain instruments without notes in IT compatible playmode (http://lpchip.com/modplug/viewtopic.php?t=2080) . Pattern number box didn't open pattern properties when using MPTm. (http://lpchip.com/modplug/viewtopic.php?t=2073) . Fixed wrong MIDI CC names in macro editor. ./ Setting volume to 0(v00) in pattern didn't necessarily set volume to 0 when using volume random variation for instrument. All other random variation behaviors are changed as well; now the 'swing' is applied directly to channel values instead of using swing addition, and by default the swing effect is reset on new note. (http://lpchip.com/modplug/viewtopic.php?t=2074) / MPTm made with this version will be recognized as IT in earlier versions. / Merged MPTm loading/saving function to that of IT. / Various validity checks for read data in ITP loading. / Removed unused files from the include directory. Modified Paths: -------------- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/AutoSaver.cpp trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Ctrl_gen.cpp 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/InputHandler.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Mpt_midi.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/OrderToPatternTable.cpp trunk/OpenMPT/mptrack/OrderToPatternTable.h trunk/OpenMPT/mptrack/Stdafx.h trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_ins.cpp 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/pattern.cpp trunk/OpenMPT/mptrack/pattern.h trunk/OpenMPT/mptrack/patternContainer.cpp trunk/OpenMPT/mptrack/patternContainer.h trunk/OpenMPT/mptrack/res/img_list.bmp trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/mptrack/typedefs.h trunk/OpenMPT/soundlib/LOAD_AMF.CPP trunk/OpenMPT/soundlib/Load_ams.cpp trunk/OpenMPT/soundlib/Load_far.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Snd_flt.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/midi.h trunk/OpenMPT/soundlib/mod_specifications.h Added Paths: ----------- trunk/OpenMPT/mptrack/MIDIMappingDialog.cpp trunk/OpenMPT/mptrack/MIDIMappingDialog.h Removed Paths: ------------- trunk/OpenMPT/include/3DL2.H trunk/OpenMPT/include/3DL2HELP.H trunk/OpenMPT/include/AudioEffect.cpp trunk/OpenMPT/include/AudioEffect.hpp trunk/OpenMPT/include/MachineInterface.h trunk/OpenMPT/include/audioeffectx.cpp trunk/OpenMPT/include/audioeffectx.h trunk/OpenMPT/soundlib/MPT_module.cpp trunk/OpenMPT/soundlib/MPT_module.h trunk/OpenMPT/soundlib/load_mptm.cpp Deleted: trunk/OpenMPT/include/3DL2.H =================================================================== --- trunk/OpenMPT/include/3DL2.H 2007-11-17 20:42:39 UTC (rev 194) +++ trunk/OpenMPT/include/3DL2.H 2008-01-12 16:49:50 UTC (rev 195) @@ -1,227 +0,0 @@ -// 3DL2.H -// - -#ifndef _3DL2_H_INCLUDED -#define _3DL2_H_INCLUDED - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -#pragma pack(push, 4) - -// I3DL2 listener property set {DA0F0520-300A-11D3-8A2B-0060970DB011} -DEFINE_GUID(DSPROPSETID_I3DL2_ListenerProperties, - 0xDA0F0520, - 0x300A, - 0x11D3, - 0x8A, 0x2B, 0x00, 0x60, 0x97, 0x0D, 0xB0, 0x11); - -typedef enum -{ -// sets all I3DL2 listener properties - DSPROPERTY_I3DL2LISTENER_ALL, -// room effect level at low frequencies - DSPROPERTY_I3DL2LISTENER_ROOM, -// room effect high-frequency level re. low frequency level - DSPROPERTY_I3DL2LISTENER_ROOMHF, -// like DS3D flRolloffFactor but for room effect - DSPROPERTY_I3DL2LISTENER_ROOMROLLOFFFACTOR, -// reverberation decay time at low-frequencies - DSPROPERTY_I3DL2LISTENER_DECAYTIME, -// high-frequency to low-frequency decay time ratio - DSPROPERTY_I3DL2LISTENER_DECAYHFRATIO, -// early reflections level relative to room effect - DSPROPERTY_I3DL2LISTENER_REFLECTIONS, -// delay time of first reflection - DSPROPERTY_I3DL2LISTENER_REFLECTIONSDELAY, -// late reverberation level relative to room effect - DSPROPERTY_I3DL2LISTENER_REVERB, -// late reverberation delay time relative to first reflection - DSPROPERTY_I3DL2LISTENER_REVERBDELAY, -// reverberation diffusion (echo density) - DSPROPERTY_I3DL2LISTENER_DIFFUSION, -// reverberation density (modal density) - DSPROPERTY_I3DL2LISTENER_DENSITY, -// reference high frequency - DSPROPERTY_I3DL2LISTENER_HFREFERENCE -} DSPROPERTY_I3DL2_LISTENERPROPERTY; - -// use this structure for DSPROPERTY_I3DL2LISTENER_ALL -// - all levels are hundredths of decibels (mB) -// - all times are in seconds (s) -typedef struct _I3DL2_LISTENERPROPERTIES -{ - LONG lRoom; // [-10000, 0] default: -10000 mB - LONG lRoomHF; // [-10000, 0] default: 0 mB - FLOAT flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 - FLOAT flDecayTime; // [0.1, 20.0] default: 1.0 s - FLOAT flDecayHFRatio; // [0.1, 2.0] default: 0.5 - LONG lReflections; // [-10000, 1000] default: -10000 mB - FLOAT flReflectionsDelay; // [0.0, 0.3] default: 0.02 s - LONG lReverb; // [-10000, 2000] default: -10000 mB - FLOAT flReverbDelay; // [0.0, 0.1] default: 0.04 s - FLOAT flDiffusion; // [0.0, 100.0] default: 100.0 % - FLOAT flDensity; // [0.0, 100.0] default: 100.0 % - FLOAT flHFReference; // [20.0, 20000.0] default: 5000.0 Hz -} I3DL2_LISTENERPROPERTIES, *LPI3DL2_LISTENERPROPERTIES; - -// property ranges and defaults: - -#define I3DL2LISTENER_MINROOM (-10000) -#define I3DL2LISTENER_MAXROOM 0 -#define I3DL2LISTENER_DEFAULTROOM (-10000) - -#define I3DL2LISTENER_MINROOMHF (-10000) -#define I3DL2LISTENER_MAXROOMHF 0 -#define I3DL2LISTENER_DEFAULTROOMHF 0 - -#define I3DL2LISTENER_MINROOMROLLOFFFACTOR 0.0f -#define I3DL2LISTENER_MAXROOMROLLOFFFACTOR 10.0f -#define I3DL2LISTENER_DEFAULTROOMROLLOFFFACTOR 0.0f - -#define I3DL2LISTENER_MINDECAYTIME 0.1f -#define I3DL2LISTENER_MAXDECAYTIME 20.0f -#define I3DL2LISTENER_DEFAULTDECAYTIME 1.0f - -#define I3DL2LISTENER_MINDECAYHFRATIO 0.1f -#define I3DL2LISTENER_MAXDECAYHFRATIO 2.0f -#define I3DL2LISTENER_DEFAULTDECAYHFRATIO 0.5f - -#define I3DL2LISTENER_MINREFLECTIONS (-10000) -#define I3DL2LISTENER_MAXREFLECTIONS 1000 -#define I3DL2LISTENER_DEFAULTREFLECTIONS (-10000) - -#define I3DL2LISTENER_MINREFLECTIONSDELAY 0.0f -#define I3DL2LISTENER_MAXREFLECTIONSDELAY 0.3f -#define I3DL2LISTENER_DEFAULTREFLECTIONSDELAY 0.02f - -#define I3DL2LISTENER_MINREVERB (-10000) -#define I3DL2LISTENER_MAXREVERB 2000 -#define I3DL2LISTENER_DEFAULTREVERB (-10000) - -#define I3DL2LISTENER_MINREVERBDELAY 0.0f -#define I3DL2LISTENER_MAXREVERBDELAY 0.1f -#define I3DL2LISTENER_DEFAULTREVERBDELAY 0.04f - -#define I3DL2LISTENER_MINDIFFUSION 0.0f -#define I3DL2LISTENER_MAXDIFFUSION 100.0f -#define I3DL2LISTENER_DEFAULTDIFFUSION 100.0f - -#define I3DL2LISTENER_MINDENSITY 0.0f -#define I3DL2LISTENER_MAXDENSITY 100.0f -#define I3DL2LISTENER_DEFAULTDENSITY 100.0f - -#define I3DL2LISTENER_MINHFREFERENCE 20.0f -#define I3DL2LISTENER_MAXHFREFERENCE 20000.0f -#define I3DL2LISTENER_DEFAULTHFREFERENCE 5000.0f - -// I3DL2 buffer property set {DA0F0521-300A-11D3-8A2B-0060970DB011} -DEFINE_GUID(DSPROPSETID_I3DL2_BufferProperties, - 0xDA0F0521, - 0x300A, - 0x11D3, - 0x8A, 0x2B, 0x00, 0x60, 0x97, 0x0D, 0xB0, 0x11); - -typedef enum -{ -// sets all I3DL2 buffer properties - DSPROPERTY_I3DL2BUFFER_ALL, -// sets both obstruction properties - DSPROPERTY_I3DL2BUFFER_OBSTRUCTIONALL, -// sets both occlusion properties - DSPROPERTY_I3DL2BUFFER_OCCLUSIONALL, -// additional direct path level correction - DSPROPERTY_I3DL2BUFFER_DIRECT, -// additional direct path high-frequency re. low-frequency level correction - DSPROPERTY_I3DL2BUFFER_DIRECTHF, -// additional room effect level correction - DSPROPERTY_I3DL2BUFFER_ROOM, -// additional room effect high-frequency re. low-frequency level correction - DSPROPERTY_I3DL2BUFFER_ROOMHF, -// like DS3D flRolloffFactor but for room effect - DSPROPERTY_I3DL2BUFFER_ROOMROLLOFFFACTOR, -// main obstruction control (attenuation at high frequencies) - DSPROPERTY_I3DL2BUFFER_OBSTRUCTION, -// obstruction low-frequency re. high-frequency ratio - DSPROPERTY_I3DL2BUFFER_OBSTRUCTIONLFRATIO, -// main occlusion control (attenuation at high frequencies) - DSPROPERTY_I3DL2BUFFER_OCCLUSION, -// occlusion low-frequency re. high-frequency ratio - DSPROPERTY_I3DL2BUFFER_OCCLUSIONLFRATIO -} DSPROPERTY_I3DL2_BUFFERPROPERTY; - -// use this structure for DSPROPERTY_I3DL2BUFFER_OBSTRUCTIONALL -// - all levels are hundredths of decibels (mB) -typedef struct _I3DL2_OBSTRUCTIONPROPERTIES -{ - LONG lHFLevel; // [-10000, 0] default: 0 mB - FLOAT flLFRatio; // [0.0, 1.0] default: 0.0 -} I3DL2_OBSTRUCTIONPROPERTIES, *LPI3DL2_OBSTRUCTIONPROPERTIES; - -// use this structure for DSPROPERTY_I3DL2BUFFER_OCCLUSIONALL -// - all levels are hundredths of decibels (mB) -typedef struct _I3DL2_OCCLUSIONPROPERTIES -{ - LONG lHFLevel; // [-10000, 0] default: 0 mB - FLOAT flLFRatio; // [0.0, 1.0] default: 0.25 -} I3DL2_OCCLUSIONPROPERTIES, *LPI3DL2_OCCLUSIONPROPERTIES; - -// use this structure for DSPROPERTY_I3DL2BUFFER_ALL -// - all levels are hundredths of decibels (mB) -typedef struct _I3DL2_BUFFERPROPERTIES -{ - LONG lDirect; // [-10000, 1000] default: 0 mB - LONG lDirectHF; // [-10000, 0] default: 0 mB - LONG lRoom; // [-10000, 1000] default: 0 mB - LONG lRoomHF; // [-10000, 0] default: 0 mB - FLOAT flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 - I3DL2_OBSTRUCTIONPROPERTIES Obstruction; - I3DL2_OCCLUSIONPROPERTIES Occlusion; -} I3DL2_BUFFERPROPERTIES, *LPI3DL2_BUFFERPROPERTIES; - -// property ranges and defaults: - -#define I3DL2BUFFER_MINDIRECT (-10000) -#define I3DL2BUFFER_MAXDIRECT 1000 -#define I3DL2BUFFER_DEFAULTDIRECT 0 - -#define I3DL2BUFFER_MINDIRECTHF (-10000) -#define I3DL2BUFFER_MAXDIRECTHF 0 -#define I3DL2BUFFER_DEFAULTDIRECTHF 0 - -#define I3DL2BUFFER_MINROOM (-10000) -#define I3DL2BUFFER_MAXROOM 1000 -#define I3DL2BUFFER_DEFAULTROOM 0 - -#define I3DL2BUFFER_MINROOMHF (-10000) -#define I3DL2BUFFER_MAXROOMHF 0 -#define I3DL2BUFFER_DEFAULTROOMHF 0 - -#define I3DL2BUFFER_MINROOMROLLOFFFACTOR 0.0f -#define I3DL2BUFFER_MAXROOMROLLOFFFACTOR 10.f -#define I3DL2BUFFER_DEFAULTROOMROLLOFFFACTOR 0.0f - -#define I3DL2BUFFER_MINOBSTRUCTION (-10000) -#define I3DL2BUFFER_MAXOBSTRUCTION 0 -#define I3DL2BUFFER_DEFAULTOBSTRUCTION 0 - -#define I3DL2BUFFER_MINOBSTRUCTIONLFRATIO 0.0f -#define I3DL2BUFFER_MAXOBSTRUCTIONLFRATIO 1.0f -#define I3DL2BUFFER_DEFAULTOBSTRUCTIONLFRATIO 0.0f - -#define I3DL2BUFFER_MINOCCLUSION (-10000) -#define I3DL2BUFFER_MAXOCCLUSION 0 -#define I3DL2BUFFER_DEFAULTOCCLUSION 0 - -#define I3DL2BUFFER_MINOCCLUSIONLFRATIO 0.0f -#define I3DL2BUFFER_MAXOCCLUSIONLFRATIO 1.0f -#define I3DL2BUFFER_DEFAULTOCCLUSIONLFRATIO 0.25f - -#pragma pack(pop) - -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif Deleted: trunk/OpenMPT/include/3DL2HELP.H =================================================================== --- trunk/OpenMPT/include/3DL2HELP.H 2007-11-17 20:42:39 UTC (rev 194) +++ trunk/OpenMPT/include/3DL2HELP.H 2008-01-12 16:49:50 UTC (rev 195) @@ -1,102 +0,0 @@ -// 3DL2HELP.H -// - -#ifndef _3DL2HELP_H_INCLUDED -#define _3DL2HELP_H_INCLUDED - -// Example listener environment presets -// for use with DSPROPERTY_I3DL2LISTENER_ALL. -// Each array contains 12 values whose order and types are defined -// by structure I3DL2_LISTENERPROPERTIES (defined in 3DL2.H). - -#define I3DL2_ENVIRONMENT_PRESET_DEFAULT \ --10000, 0,0.0f, 1.00f,0.50f,-10000,0.020f,-10000,0.040f,100.0f,100.0f,5000.0f - -#define I3DL2_ENVIRONMENT_PRESET_GENERIC \ - -1000, -100,0.0f, 1.49f,0.83f, -2602,0.007f, 200,0.011f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_PADDEDCELL \ - -1000,-6000,0.0f, 0.17f,0.10f, -1204,0.001f, 207,0.002f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_ROOM \ - -1000, -454,0.0f, 0.40f,0.83f, -1646,0.002f, 53,0.003f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_BATHROOM \ - -1000,-1200,0.0f, 1.49f,0.54f, -370,0.007f, 1030,0.011f,100.0f, 60.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_LIVINGROOM \ - -1000,-6000,0.0f, 0.50f,0.10f, -1376,0.003f, -1104,0.004f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_STONEROOM \ - -1000, -300,0.0f, 2.31f,0.64f, -711,0.012f, 83,0.017f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_AUDITORIUM \ - -1000, -476,0.0f, 4.32f,0.59f, -789,0.020f, -289,0.030f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_CONCERTHALL \ - -1000, -500,0.0f, 3.92f,0.70f, -1230,0.020f, -2,0.029f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_CAVE \ - -1000, 0,0.0f, 2.91f,1.30f, -602,0.015f, -302,0.022f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_ARENA \ - -1000, -698,0.0f, 7.24f,0.33f, -1166,0.020f, 16,0.030f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_HANGAR \ - -1000,-1000,0.0f,10.05f,0.23f, -602,0.020f, 198,0.030f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY \ - -1000,-4000,0.0f, 0.30f,0.10f, -1831,0.002f, -1630,0.030f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_HALLWAY \ - -1000, -300,0.0f, 1.49f,0.59f, -1219,0.007f, 441,0.011f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR \ - -1000, -237,0.0f, 2.70f,0.79f, -1214,0.013f, 395,0.020f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_ALLEY \ - -1000, -270,0.0f, 1.49f,0.86f, -1204,0.007f, -4,0.011f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_FOREST \ - -1000,-3300,0.0f, 1.49f,0.54f, -2560,0.162f, -613,0.088f, 79.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_CITY \ - -1000, -800,0.0f, 1.49f,0.67f, -2273,0.007f, -2217,0.011f, 50.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_MOUNTAINS \ - -1000,-2500,0.0f, 1.49f,0.21f, -2780,0.300f, -2014,0.100f, 27.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_QUARRY \ - -1000,-1000,0.0f, 1.49f,0.83f,-10000,0.061f, 500,0.025f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_PLAIN \ - -1000,-2000,0.0f, 1.49f,0.50f, -2466,0.179f, -2514,0.100f, 21.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_PARKINGLOT \ - -1000, 0,0.0f, 1.65f,1.50f, -1363,0.008f, -1153,0.012f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_SEWERPIPE \ - -1000,-1000,0.0f, 2.81f,0.14f, 429,0.014f, 648,0.021f, 80.0f, 60.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_UNDERWATER \ - -1000,-4000,0.0f, 1.49f,0.10f, -449,0.007f, 1700,0.011f,100.0f,100.0f,5000.0f - -// Examples simulating General MIDI 2'musical' reverb presets -// -// Name (Decay time) Description -// -// Small Room (1.1s) A small size room with a length of 5m or so. -// Medium Room (1.3s) A medium size room with a length of 10m or so. -// Large Room (1.5s) A large size room suitable for live performances. -// Medium Hall (1.8s) A medium size concert hall. -// Large Hall (1.8s) A large size concert hall suitable for a full orchestra. -// Plate (1.3s) A plate reverb simulation. - -#define I3DL2_ENVIRONMENT_PRESET_SMALLROOM \ - -1000, -600,0.0f, 1.10f,0.83f, -400,0.005f, 500,0.010f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM \ - -1000, -600,0.0f, 1.30f,0.83f, -1000,0.010f, -200,0.020f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_LARGEROOM \ - -1000, -600,0.0f, 1.50f,0.83f, -1600,0.020f, -1000,0.040f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL \ - -1000, -600,0.0f, 1.80f,0.70f, -1300,0.015f, -800,0.030f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_LARGEHALL \ - -1000, -600,0.0f, 1.80f,0.70f, -2000,0.030f, -1400,0.060f,100.0f,100.0f,5000.0f -#define I3DL2_ENVIRONMENT_PRESET_PLATE \ - -1000, -200,0.0f, 1.30f,0.90f, 0,0.002f, 0,0.010f,100.0f, 75.0f,5000.0f - -// Example material transmission presets -// for use with DSPROPERTY_I3DL2BUFFER_OCCLUSIONALL -// or DSPROPERTY_I3DL2BUFFER_OBSTRUCTIONALL. -// Each array contains 2 values whose order and types are defined -// by structure I3DL2_OCCLUSIONPROPERTIES -// or I3DL2_OBSTRUCTIONPROPERTIES (defined in 3DL2.H). - -#define I3DL2_MATERIAL_PRESET_SINGLEWINDOW -2800,0.71f -#define I3DL2_MATERIAL_PRESET_DOUBLEWINDOW -5000,0.40f -#define I3DL2_MATERIAL_PRESET_THINDOOR -1800,0.66f -#define I3DL2_MATERIAL_PRESET_THICKDOOR -4400,0.64f -#define I3DL2_MATERIAL_PRESET_WOODWALL -4000,0.50f -#define I3DL2_MATERIAL_PRESET_BRICKWALL -5000,0.60f -#define I3DL2_MATERIAL_PRESET_STONEWALL -6000,0.68f -#define I3DL2_MATERIAL_PRESET_CURTAIN -1200,0.15f - -#endif Deleted: trunk/OpenMPT/include/AudioEffect.cpp =================================================================== --- trunk/OpenMPT/include/AudioEffect.cpp 2007-11-17 20:42:39 UTC (rev 194) +++ trunk/OpenMPT/include/AudioEffect.cpp 2008-01-12 16:49:50 UTC (rev 195) @@ -1,393 +0,0 @@ -//------------------------------------------------------------------------------------------------------- -// VST Plug-Ins SDK -// Version 1.0 -// \xA9 2003 Steinberg Media Technologies, All Rights Reserved -// -// you should not have to edit this file -// use override methods instead -//------------------------------------------------------------------------------------------------------- - -#include <stddef.h> -#include <string.h> -#include <stdio.h> -#include <math.h> - -#ifndef __AudioEffect__ -#include "AudioEffect.hpp" -#endif - -#ifndef __AEffEditor__ -#include "AEffEditor.hpp" -#endif - -//------------------------------------------------------------------------------------------------------- -long dispatchEffectClass (AEffect *e, long opCode, long index, long value, void *ptr, float opt) -{ - AudioEffect *ae = (AudioEffect*)(e->object); - - if (opCode == effClose) - { - ae->dispatcher (opCode, index, value, ptr, opt); - delete ae; - return 1; - } - - return ae->dispatcher (opCode, index, value, ptr, opt); -} - -//------------------------------------------------------------------------------------------------------- -float getParameterClass (AEffect *e, long index) -{ - AudioEffect *ae = (AudioEffect*)(e->object); - return ae->getParameter (index); -} - -//------------------------------------------------------------------------------------------------------- -void setParameterClass (AEffect *e, long index, float value) -{ - AudioEffect *ae = (AudioEffect*)(e->object); - ae->setParameter (index, value); -} - -//------------------------------------------------------------------------------------------------------- -void processClass (AEffect *e, float **inputs, float **outputs, long sampleFrames) -{ - AudioEffect *ae = (AudioEffect*)(e->object); - ae->process (inputs, outputs, sampleFrames); -} - -//------------------------------------------------------------------------------------------------------- -void processClassReplacing (AEffect *e, float **inputs, float **outputs, long sampleFrames) -{ - AudioEffect *ae = (AudioEffect*)(e->object); - ae->processReplacing (inputs, outputs, sampleFrames); -} - - -//------------------------------------------------------------------------------------------------------- -// AudioEffect Implementation -//------------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------------- -AudioEffect::AudioEffect (audioMasterCallback audioMaster, long numPrograms, long numParams) -{ - this->audioMaster = audioMaster; - editor = 0; - this->numPrograms = numPrograms; - this->numParams = numParams; - curProgram = 0; - - memset(&cEffect, 0, sizeof (cEffect)); - cEffect.magic = kEffectMagic; - cEffect.dispatcher = dispatchEffectClass; - cEffect.process = processClass; - cEffect.setParameter = setParameterClass; - cEffect.getParameter = getParameterClass; - cEffect.numPrograms = numPrograms; - cEffect.numParams = numParams; - cEffect.numInputs = 1; - cEffect.numOutputs = 2; - cEffect.flags = 0; - cEffect.resvd1 = 0; - cEffect.resvd2 = 0; - cEffect.initialDelay = 0; - cEffect.realQualities = 0; - cEffect.offQualities = 0; - cEffect.ioRatio = 1.f; - cEffect.object = this; - cEffect.user = 0; - cEffect.uniqueID = CCONST ('N', 'o', 'E', 'f'); // you must set this! - cEffect.version = 1; - cEffect.processReplacing = processClassReplacing; - - sampleRate = 44100.f; - blockSize = 1024L; -} - -//------------------------------------------------------------------------------------------------------- -AudioEffect::~AudioEffect () -{ - if (editor) - delete editor; -} - -//------------------------------------------------------------------------------------------------------- -long AudioEffect::dispatcher (long opCode, long index, long value, void *ptr, float opt) -{ - long v = 0; - - switch (opCode) - { - case effOpen: open (); break; - case effClose: close (); break; - case effSetProgram: if (value < numPrograms) setProgram (value); break; - case effGetProgram: v = getProgram (); break; - case effSetProgramName: setProgramName ((char *)ptr); break; - case effGetProgramName: getProgramName ((char *)ptr); break; - case effGetParamLabel: getParameterLabel (index, (char *)ptr); break; - case effGetParamDisplay: getParameterDisplay (index, (char *)ptr); break; - case effGetParamName: getParameterName (index, (char *)ptr); break; - - case effSetSampleRate: setSampleRate (opt); break; - case effSetBlockSize: setBlockSize (value); break; - case effMainsChanged: if (!value) suspend (); else resume (); break; - case effGetVu: v = (long)(getVu () * 32767.); break; - - - // Editor - case effEditGetRect: if (editor) v = editor->getRect ((ERect **)ptr); break; - case effEditOpen: if (editor) v = editor->open (ptr); break; - case effEditClose: if (editor) editor->close (); break; - case effEditIdle: if (editor) editor->idle (); break; - - #if MAC - case effEditDraw: if (editor) editor->draw ((ERect *)ptr); break; - case effEditMouse: if (editor) v = editor->mouse (index, value); break; - case effEditKey: if (editor) v = editor->key (value); break; - case effEditTop: if (editor) editor->top (); break; - case effEditSleep: if (editor) editor->sleep (); break; - #endif - - case effIdentify: v = CCONST ('N', 'v', 'E', 'f'); break; - case effGetChunk: v = getChunk ((void**)ptr, index ? true : false); break; - case effSetChunk: v = setChunk (ptr, value, index ? true : false); break; - } - return v; -} - -//------------------------------------------------------------------------------------------------------- -long AudioEffect::getMasterVersion () -{ - long version = 1; - if (audioMaster) - { - version = audioMaster (&cEffect, audioMasterVersion, 0, 0, 0, 0); - if (!version) // old - version = 1; - } - return version; -} - -//------------------------------------------------------------------------------------------------------- -long AudioEffect::getCurrentUniqueId () -{ - long id = 0; - if (audioMaster) - id = audioMaster (&cEffect, audioMasterCurrentId, 0, 0, 0, 0); - return id; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::masterIdle () -{ - if (audioMaster) - audioMaster (&cEffect, audioMasterIdle, 0, 0, 0, 0); -} - -//------------------------------------------------------------------------------------------------------- -bool AudioEffect::isInputConnected (long input) -{ - long ret = 0; - if (audioMaster) - ret = audioMaster (&cEffect, audioMasterPinConnected, input, 0, 0, 0); - return ret ? false : true; // return value is 0 for true -} - -//------------------------------------------------------------------------------------------------------- -bool AudioEffect::isOutputConnected (long output) -{ - long ret = 0; - if (audioMaster) - ret = audioMaster (&cEffect, audioMasterPinConnected, output, 1, 0, 0); - return ret ? false : true; // return value is 0 for true -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::setParameterAutomated (long index, float value) -{ - setParameter (index, value); - if (audioMaster) - audioMaster (&cEffect, audioMasterAutomate, index, 0, 0, value); // value is in opt -} - -//------------------------------------------------------------------------------------------------------- -// Flags -//------------------------------------------------------------------------------------------------------- -void AudioEffect::hasVu (bool state) -{ - if (state) - cEffect.flags |= effFlagsHasVu; - else - cEffect.flags &= ~effFlagsHasVu; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::hasClip (bool state) -{ - if (state) - cEffect.flags |= effFlagsHasClip; - else - cEffect.flags &= ~effFlagsHasClip; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::canMono (bool state) -{ - if (state) - cEffect.flags |= effFlagsCanMono; - else - cEffect.flags &= ~effFlagsCanMono; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::canProcessReplacing (bool state) -{ - if (state) - cEffect.flags |= effFlagsCanReplacing; - else - cEffect.flags &= ~effFlagsCanReplacing; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::programsAreChunks (bool state) -{ - if (state) - cEffect.flags |= effFlagsProgramChunks; - else - cEffect.flags &= ~effFlagsProgramChunks; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::setRealtimeQualities (long qualities) -{ - cEffect.realQualities = qualities; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::setOfflineQualities (long qualities) -{ - cEffect.offQualities = qualities; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::setInitialDelay (long delay) -{ - cEffect.initialDelay = delay; -} - -//------------------------------------------------------------------------------------------------------- -// Strings Conversion -//------------------------------------------------------------------------------------------------------- -void AudioEffect::dB2string (float value, char *text) -{ - if (value <= 0) - #if MAC - strcpy (text, "-\xB0"); - #else - strcpy (text, "-oo"); - #endif - else - float2string ((float)(20. * log10 (value)), text); -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::Hz2string (float samples, char *text) -{ - float sampleRate = getSampleRate (); - if (!samples) - float2string (0, text); - else - float2string (sampleRate / samples, text); -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::ms2string (float samples, char *text) -{ - float2string ((float)(samples * 1000. / getSampleRate ()), text); -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::float2string (float value, char *text) -{ - long c = 0, neg = 0; - char string[32]; - char *s; - double v, integ, i10, mantissa, m10, ten = 10.; - - v = (double)value; - if (v < 0) - { - neg = 1; - value = -value; - v = -v; - c++; - if (v > 9999999.) - { - strcpy (string, "Huge!"); - return; - } - } - else if( v > 99999999.) - { - strcpy (string, "Huge!"); - return; - } - - s = string + 31; - *s-- = 0; - *s-- = '.'; - c++; - - integ = floor (v); - i10 = fmod (integ, ten); - *s-- = (char)((long)i10 + '0'); - integ /= ten; - c++; - while (integ >= 1. && c < 8) - { - i10 = fmod (integ, ten); - *s-- = (char)((long)i10 + '0'); - integ /= ten; - c++; - } - if (neg) - *s-- = '-'; - strcpy (text, s + 1); - if (c >= 8) - return; - - s = string + 31; - *s-- = 0; - mantissa = fmod (v, 1.); - mantissa *= pow (ten, (double)(8 - c)); - while (c < 8) - { - if (mantissa <= 0) - *s-- = '0'; - else - { - m10 = fmod (mantissa, ten); - *s-- = (char)((long)m10 + '0'); - mantissa /= 10.; - } - c++; - } - strcat (text, s + 1); -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::long2string (long value, char *text) -{ - char string[32]; - - if (value >= 100000000) - { - strcpy (text, "Huge!"); - return; - } - sprintf (string, "%7d", (int)value); - string[8] = 0; - strcpy (text, (char *)string); -} -//------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------- Deleted: trunk/OpenMPT/include/AudioEffect.hpp =================================================================== --- trunk/OpenMPT/include/AudioEffect.hpp 2007-11-17 20:42:39 UTC (rev 194) +++ trunk/OpenMPT/include/AudioEffect.hpp 2008-01-12 16:49:50 UTC (rev 195) @@ -1,131 +0,0 @@ -//------------------------------------------------------------------------------------------------------- -// VST Plug-Ins SDK -// Version 1.0 -// \xA9 2003, Steinberg Media Technologies, All Rights Reserved -//------------------------------------------------------------------------------------------------------- - -#ifndef __AudioEffect__ -#define __AudioEffect__ - -#ifndef __AEffect__ -#include "AEffect.h" // "c" interface -#endif - -class AEffEditor; -class AudioEffect; - -//------------------------------------------------------------------------------------------------------- -// Needs to be defined by the audio effect and is -// called to create the audio effect object instance. -AudioEffect* createEffectInstance (audioMasterCallback audioMaster); - -long dispatchEffectClass (AEffect *e, long opCode, long index, long value, void *ptr, float opt); -float getParameterClass (long index); -void setParameterClass (long index, float value); -void processClass (AEffect *e, float **inputs, float **outputs, long sampleFrames); -void processClassReplacing (AEffect *e, float **inputs, float **outputs, long sampleFrames); - -//------------------------------------------------------------------------------------------------------- -class AudioEffect -{ -friend class AEffEditor; -friend long dispatchEffectClass (AEffect *e, long opCode, long index, long value, void *ptr, float opt); -friend float getParameterClass (AEffect *e, long index); -friend void setParameterClass (AEffect *e, long index, float value); -friend void processClass (AEffect *e, float **inputs, float **outputs, long sampleFrames); -friend void processClassReplacing (AEffect *e, float **inputs, float **outputs, long sampleFrames); - -public: - AudioEffect (audioMasterCallback audioMaster, long numPrograms, long numParams); - virtual ~AudioEffect (); - - virtual void setParameter (long index, float value) { index = index; value = value; } - virtual float getParameter (long index) { index = index; return 0; } - virtual void setParameterAutomated (long index, float value); - - AEffect *getAeffect () { return &cEffect; } // Returns the AEffect Structure - - void setEditor (AEffEditor *editor) - { this->editor = editor; - if (editor) cEffect.flags |= effFlagsHasEditor; - else cEffect.flags &= ~effFlagsHasEditor; } // Should be called if you want to define your own editor - - //---Called from audio master (Host -> Plug)--------------- - virtual void process (float **inputs, float **outputs, long sampleFrames) = 0; - virtual void processReplacing (float **inputs, float **outputs, long sampleFrames) - { inputs = inputs; outputs = outputs; sampleFrames = sampleFrames; } - - virtual long dispatcher (long opCode, long index, long value, void *ptr, float opt); // Opcodes dispatcher - - virtual void open () {} // Called when Plugin is initialized - virtual void close () {} // Called when Plugin will be released - - //---Program---------------------------- - virtual long getProgram () { return curProgram; } - virtual void setProgram (long program) { curProgram = program; }// Don't forget to set curProgram - virtual void setProgramName (char *name) { *name = 0; } // All following refer to curProgram - virtual void getProgramName (char *name) { *name = 0; } - - virtual void getParameterLabel (long index, char *label) { index = index; *label = 0; } // example: "dB" - virtual void getParameterDisplay (long index, char *text) { index = index; *text = 0; } // example: "6.01" - virtual void getParameterName (long index, char *text) { index = index; *text = 0; } // example: "Volume" - - virtual float getVu () { return 0; } - - virtual long getChunk (void** data, bool isPreset = false) { return 0; } // Returns the Size in bytes of the chunk (Plugin allocates the data array) - virtual long setChunk (void* data, long byteSize, bool isPreset = false) { return 0; } - - virtual void setSampleRate (float sampleRate) { this->sampleRate = sampleRate; } - virtual void setBlockSize (long blockSize) { this->blockSize = blockSize; } - - virtual void suspend () {} // Called when Plugin is switched to Off - virtual void resume () {} // Called when Plugin is switched to On - - //---Setup--------------------------- - virtual void setUniqueID (long iD) { cEffect.uniqueID = iD; } // must call this! - virtual void setNumInputs (long inputs) { cEffect.numInputs = inputs; } - virtual void setNumOutputs (long outputs) { cEffect.numOutputs = outputs; } - - virtual void hasVu (bool state = true); - virtual void hasClip (bool state = true); - virtual void canMono (bool state = true); - virtual void canProcessReplacing (bool state = true); // Tells that the processReplacing () could be used - virtual void programsAreChunks (bool state = true); - virtual void setRealtimeQualities (long qualities); - virtual void setOfflineQualities (long qualities); - virtual void setInitialDelay (long delay); // Uses to report the Plugin's latency (Group Delay) - - //---Inquiry------------------------- - virtual float getSampleRate () { return sampleRate; } - virtual long getBlockSize () { return blockSize; } - - //---Host communication-------------- - virtual long getMasterVersion (); - virtual long getCurrentUniqueId (); - virtual void masterIdle (); - virtual bool isInputConnected (long input); - virtual bool isOutputConnected (long output); - - //---Tools--------------------------- - virtual void dB2string (float value, char *text); - virtual void Hz2string (float samples, char *text); - virtual void ms2string (float samples, char *text); - virtual void float2string (float value, char *string); - virtual void long2string (long value, char *text); - -protected: - //---Members------------------------- - float sampleRate; - AEffEditor *editor; - audioMasterCallback audioMaster; - long numPrograms; - long numParams; - long curProgram; - long blockSize; - AEffect cEffect; -}; - -#endif // __AudioEffect__ -//------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------- - Deleted: trunk/OpenMPT/include/MachineInterface.h =================================================================== --- trunk/OpenMPT/include/MachineInterface.h 2007-11-17 20:42:39 UTC (rev 194) +++ trunk/OpenMPT/include/MachineInterface.h 2008-01-12 16:49:50 UTC (rev 195) @@ -1,514 +0,0 @@ -// Copyright (C) 1997-2000 Oskari Tammelin (ot...@ik...) -// This header file may be used to write _freeware_ DLL "machines" for Buzz -// Using it for anything else is not allowed without a permission from the author - -#ifndef __MACHINE_INTERFACE_H -#define __MACHINE_INTERFACE_H - -#define MI_VERSION 15 - -typedef unsigned char byte; -typedef unsigned short word; -typedef unsigned long dword; - -double const PI = 3.14159265358979323846; - -#define MAX_BUFFER_LENGTH 256 // in number of samples - -// machine types -#define MT_MASTER 0 -#define MT_GENERATOR 1 -#define MT_EFFECT 2 - -// special parameter values -#define NOTE_NO 0 -#define NOTE_OFF 255 -#define NOTE_MIN 1 // C-0 -#define NOTE_MAX ((16 * 9) + 12) // B-9 -#define SWITCH_OFF 0 -#define SWITCH_ON 1 -#define SWITCH_NO 255 -#define WAVE_MIN 1 -#define WAVE_MAX 200 -#define WAVE_NO 0 - -// CMachineParameter flags -#define MPF_WAVE 1 -#define MPF_STATE 2 -#define MPF_TICK_ON_EDIT 4 - -// CMachineInfo flags -#define MIF_MONO_TO_STEREO (1<<0) -#define MIF_PLAYS_WAVES (1<<1) -#define MIF_USES_LIB_INTERFACE (1<<2) -#define MIF_USES_INSTRUMENTS (1<<3) -#define MIF_DOES_INPUT_MIXING (1<<4) -#define MIF_NO_OUTPUT (1<<5) // used for effect machines that don't actually use any outputs (WaveOutput, AuxSend etc.) -#define MIF_CONTROL_MACHINE (1<<6) // used to control other (non MIF_CONTROL_MACHINE) machines -#define MIF_INTERNAL_AUX (1<<7) // uses internal aux bus (jeskola mixer and jeskola mixer aux) - -// work modes -#define WM_NOIO 0 -#define WM_READ 1 -#define WM_WRITE 2 -#define WM_READWRITE 3 - -// state flags -#define SF_PLAYING 1 -#define SF_RECORDING 2 - - -enum BEventType -{ - DoubleClickMachine, // return true to ignore default handler (open parameter dialog), no parameters - gDeleteMachine // data = CMachine *, param = ThisMac - -}; - -class CMachineInterface; -typedef bool (CMachineInterface::*EVENT_HANDLER_PTR)(void *); - - -enum CMPType { pt_note, pt_switch, pt_byte, pt_word }; - -class CMachineParameter -{ -public: - - CMPType Type; // pt_byte - char const *Name; // Short name: "Cutoff" - char const *Description;// Longer description: "Cutoff Frequency (0-7f)" - int MinValue; // 0 - int MaxValue; // 127 - int NoValue; // 255 - int Flags; - int DefValue; // default value for params that have MPF_STATE flag set -}; - -class CMachineAttribute -{ -public: - char const *Name; - int MinValue; - int MaxValue; - int DefValue; -}; - -class CMasterInfo -{ -public: - int BeatsPerMin; // [16..500] - int TicksPerBeat; // [1..32] - int SamplesPerSec; // usually 44100, but machines should support any rate from 11050 to 96000 - int SamplesPerTick; // (int)((60 * SPS) / (BPM * TPB)) - int PosInTick; // [0..SamplesPerTick-1] - float TicksPerSec; // (float)SPS / (float)SPT - -}; - -// CWaveInfo flags -#define WF_LOOP 1 -#define WF_STEREO 8 -#define WF_BIDIR_LOOP 16 - -class CWaveInfo -{ -public: - int Flags; - float Volume; - -}; - -class CWaveLevel -{ -public: - int numSamples; - short *pSamples; - int RootNote; - int SamplesPerSec; - int LoopStart; - int LoopEnd; -}; - -// oscillator waveforms (used with GetOscillatorTable function) -#define OWF_SINE 0 -#define OWF_SAWTOOTH 1 -#define OWF_PULSE 2 // square -#define OWF_TRIANGLE 3 -#define OWF_NOISE 4 -#define OWF_303_SAWTOOTH 5 - -// each oscillator table contains one full cycle of a bandlimited waveform at 11 levels -// level 0 = 2048 samples -// level 1 = 1024 samples -// level 2 = 512 samples -// ... -// level 9 = 8 samples -// level 10 = 4 samples -// level 11 = 2 samples -// -// the waves are normalized to 16bit signed integers -// -// GetOscillatorTable retusns pointer to a table -// GetOscTblOffset returns offset in the table for a specified level - -inline int GetOscTblOffset(int const level) -{ - ASSERT(level >= 0 && level <= 10); - return (2048+1024+512+256+128+64+32+16+8+4) & ~((2048+1024+512+256+128+64+32+16+8+4) >> level); -} - -class CPattern; -class CSequence; -class CMachineInterfaceEx; -class CMachine; - -class CMachineDataOutput; -class CMachineInfo; - -class CMICallbacks -{ -public: - virtual CWaveInfo const *GetWave(int const i); - virtual CWaveLevel const *GetWaveLevel(int const i, int const level); - virtual void MessageBox(char const *txt); - virtual void Lock(); - virtual void Unlock(); - virtual int GetWritePos(); - virtual int GetPlayPos(); - virtual float *GetAuxBuffer(); - virtual void ClearAuxBuffer(); - virtual int GetFreeWave(); - virtual bool AllocateWave(int const i, int const size, char const *name); - virtual void ScheduleEvent(int const time, dword const data); - virtual void MidiOut(int const dev, dword const data); - virtual short const *GetOscillatorTable(int const waveform); - - // envelopes - virtual int GetEnvSize(int const wave, int const env); - virtual bool GetEnvPoint(int const wave, int const env, int const i, word &x, word &y, int &flags); - - virtual CWaveLevel const *GetNearestWaveLevel(int const i, int const note); - - // pattern editing - virtual void SetNumberOfTracks(int const n); - virtual CPattern *CreatePattern(char const *name, int const length); - virtual CPattern *GetPattern(int const index); - virtual char const *GetPatternName(CPattern *ppat); - virtual void RenamePattern(char const *oldname, char const *newname); - virtual void DeletePattern(CPattern *ppat); - virtual int GetPatternData(CPattern *ppat, int const row, int const group, int const track, int const field); - virtual void SetPatternData(CPattern *ppat, int const row, int const group, int const track, int const field, int const value); - - // sequence editing - virtual CSequence *CreateSequence(); - virtual void DeleteSequence(CSequence *pseq); - - - // special ppat values for GetSequenceData and SetSequenceData - // empty = NULL - // <break> = (CPattern *)1 - // <mute> = (CPattern *)2 - // <thru> = (CPattern *)3 - virtual CPattern *GetSequenceData(int const row); - virtual void SetSequenceData(int const row, CPattern *ppat); - - - // buzz v1.2 (MI_VERSION 15) additions start here - - virtual void SetMachineInterfaceEx(CMachineInterfaceEx *pex); - // group 1=global, 2=track - virtual void ControlChange__obsolete__(int group, int track, int param, int value); // set value of parameter - - // direct calls to audiodriver, used by WaveInput and WaveOutput - // shouldn't be used for anything else - virtual int ADGetnumChannels(bool input); - virtual void ADWrite(int channel, float *psamples, int numsamples); - virtual void ADRead(int channel, float *psamples, int numsamples); - - virtual CMachine *GetThisMachine(); // only call this in Init()! - virtual void ControlChange(CMachine *pmac, int group, int track, int param, int value); // set value of parameter (group & 16 == don't record) - - // returns pointer to the sequence if there is a pattern playing - virtual CSequence *GetPlayingSequence(CMachine *pmac); - - // gets ptr to raw pattern data for row of a track of a currently playing pattern (or something like that) - virtual void *GetPlayingRow(CSequence *pseq, int group, int track); - - virtual int GetStateFlags(); - - virtual void SetnumOutputChannels(CMachine *pmac, int n); // if n=1 Work(), n=2 WorkMonoToStereo() - - virtual void SetEventHandler(CMachine *pmac, BEventType et, EVENT_HANDLER_PTR p, void *param); - - virtual char const *GetWaveName(int const i); - - virtual void SetInternalWaveName(CMachine *pmac, int const i, char const *name); // i >= 1, NULL name to clear - - virtual void GetMachineNames(CMachineDataOutput *pout); // *pout will get one name per Write() - virtual CMachine *GetMachine(char const *name); - virtual CMachineInfo const *GetMachineInfo(CMachine *pmac); - virtual char const *GetMachineName(CMachine *pmac); - - virtual bool GetInput(int index, float *psamples, int numsamples, bool stereo, float *extrabuffer); -}; - - -class CLibInterface -{ -public: - virtual void GetInstrumentList(CMachineDataOutput *pout) {} - - // make some space to vtable so this interface can be extended later - virtual void Dummy1() {} - virtual void Dummy2() {} - virtual void Dummy3() {} - virtual void Dummy4() {} - virtual void Dummy5() {} - virtual void Dummy6() {} - virtual void Dummy7() {} - virtual void Dummy8() {} - virtual void Dummy9() {} - virtual void Dummy10() {} - virtual void Dummy11() {} - virtual void Dummy12() {} - virtual void Dummy13() {} - virtual void Dummy14() {} - virtual void Dummy15() {} - virtual void Dummy16() {} - virtual void Dummy17() {} - virtual void Dummy18() {} - virtual void Dummy19() {} - virtual void Dummy20() {} - virtual void Dummy21() {} - virtual void Dummy22() {} - virtual void Dummy23() {} - virtual void Dummy24() {} - virtual void Dummy25() {} - virtual void Dummy26() {} - virtual void Dummy27() {} - virtual void Dummy28() {} - virtual void Dummy29() {} - virtual void Dummy30() {} - virtual void Dummy31() {} - virtual void Dummy32() {} - - -}; - - -class CMachineInfo -{ -public: - int Type; // MT_GENERATOR or MT_EFFECT, - int Version; // MI_VERSION - // v1.2: high word = internal machine version - // higher version wins if two copies of machine found - int Flags; - int minTracks; // [0..256] must be >= 1 if numTrackParameters > 0 - int maxTracks; // [minTracks..256] - int numGlobalParameters; - int numTrackParameters; - CMachineParameter const **Parameters; - int numAttributes; - CMachineAttribute const **Attributes; - char const *Name; // "Jeskola Reverb" - char const *ShortName; // "Reverb" - char const *Author; // "Oskari Tammelin" - char const *Commands; // "Command1\nCommand2\nCommand3..." - CLibInterface *pLI; // ignored if MIF_USES_LIB_INTERFACE is not set -}; - -class CMachineDataInput -{ -public: - virtual void Read(void *pbuf, int const numbytes); - - void Read(int &d) { Read(&d, sizeof(int)); } - void Read(dword &d) { Read(&d, sizeof(dword)); } - void Read(short &d) { Read(&d, sizeof(short)); } - void Read(word &d) { Read(&d, sizeof(word)); } - void Read(char &d) { Read(&d, sizeof(char)); } - void Read(byte &d) { Read(&d, sizeof(byte)); } - void Read(float &d) { Read(&d, sizeof(float)); } - void Read(double &d) { Read(&d, sizeof(double)); } - void Read(bool &d) { Read(&d, sizeof(bool)); } - -}; - -class CMachineDataOutput -{ -public: - virtual void Write(void *pbuf, int const numbytes); - - void Write(int d) { Write(&d, sizeof(int)); } - void Write(dword d) { Write(&d, sizeof(dword)); } - void Write(short d) { Write(&d, sizeof(short)); } - void Write(word d) { Write(&d, sizeof(word)); } - void Write(char d) { Write(&d, sizeof(char)); } - void Write(byte d) { Write(&d, sizeof(byte)); } - void Write(float d) { Write(&d, sizeof(float)); } - void Write(double d) { Write(&d, sizeof(double)); } - void Write(bool d) { Write(&d, sizeof(bool)); } - void Write(char const *str) { Write((void *)str, strlen(str)+1); } - -}; - -// envelope info flags -#define EIF_SUSTAIN 1 -#define EIF_LOOP 2 - -class CEnvelopeInfo -{ -public: - char const *Name; - int Flags; -}; - -class CMachineInterface -{ -public: - virtual ~CMachineInterface() {} - virtual void Init(CMachineDataInput * const pi) {} - virtual void Tick() {} - virtual bool Work(float *psamples, int numsamples, int const mode) { return false; } - virtual bool WorkMonoToStereo(float *pin, float *pout, int numsamples, int const mode) { return false; } - virtual void Stop() {} - virtual void Save(CMachineDataOutput * const po) {} - virtual void AttributesChanged() {} - virtual void Command(int const i) {} - - virtual void SetNumTracks(int const n) {} - virtual void MuteTrack(int const i) {} - virtual bool IsTrackMuted(int const i) const { return false; } - - virtual void MidiNote(int const channel, int const value, int const velocity) {} - virtual void Event(dword const data) {} - - virtual char const *DescribeValue(int const param, int const value) { return NULL; } - - virtual CEnvelopeInfo const **GetEnvelopeInfos() { return NULL; } - - virtual bool PlayWave(int const wave, int const note, float const volume) { return false; } - virtual void StopWave() {} - virtual int GetWaveEnvPlayPos(int const env) { return -1; } - - -public: - // initialize these members in the constructor - void *GlobalVals; - void *TrackVals; - int *AttrVals; - - // these members are initialized by the - // engine right after it calls CreateMachine() - // don't touch them in the constructor - CMasterInfo *pMasterInfo; - CMICallbacks *pCB; - -}; - -// buzz v1.2 extended machine interface -class CMachineInterfaceEx -{ -public: - virtual char const *DescribeParam(int const param) { return NULL; } // use this to dynamically change name of parameter - virtual bool SetInstrument(char const *name) { return false; } - - virtual void GetSubMenu(int const i, CMachineDataOutput *pout) {} - - virtual void AddInput(char const *macname, bool stereo) {} // called when input is added to a machine - virtual void DeleteInput(char const *macename) {} - virtual void RenameInput(char const *macoldname, char const *macnewname) {} - - virtual void Input(float *psamples, int numsamples, float amp) {} // if MIX_DOES_INPUT_MIXING - - virtual void MidiControlChange(int const ctrl, int const channel, int const value) {} - - virtual void SetInputChannels(char const *macname, bool stereo) {} - - virtual bool HandleInput(int index, int amp, int pan) { return false; } - - // make some space to vtable so this interface can be extended later - virtual void Dummy1() {} - virtual void Dummy2() {} - virtual void Dummy3() {} - virtual void Dummy4() {} - virtual void Dummy5() {} - virtual void Dummy6() {} - virtual void Dummy7() {} - virtual void Dummy8() {} - virtual void Dummy9() {} - virtual void Dummy10() {} - virtual void Dummy11() {} - virtual void Dummy12() {} - virtual void Dummy13() {} - virtual void Dummy14() {} - virtual void Dummy15() {} - virtual void Dummy16() {} - virtual void Dummy17() {} - virtual void Dummy18() {} - virtual void Dummy19() {} - virtual void Dummy20() {} - virtual void Dummy21() {} - virtual void Dummy22() {} - virtual void Dummy23() {} - virtual void Dummy24() {} - virtual void Dummy25() {} - virtual void Dummy26() {} - virtual void Dummy27() {} - virtual void Dummy28() {} - virtual void Dummy29() {} - virtual void Dummy30() {} - virtual void Dummy31() {} - virtual void Dummy32() {} - -}; - -class CMILock -{ -public: - CMILock(CMICallbacks *p) { pCB = p; pCB->Lock(); } - ~CMILock() { pCB->Unlock(); } -private: - CMICallbacks *pCB; -}; - -#define MACHINE_LOCK CMILock __machinelock(pCB); - -#ifdef STATIC_BUILD - - typedef CMachineInfo const *(__cdecl *GET_INFO)(); - typedef CMachineInterface *(__cdecl *CREATE_MACHINE)(); - - extern void RegisterMachine(CMachineInfo const *pmi, GET_INFO gi, CREATE_MACHINE cm); - -#define DLL_EXPORTS(INIT_FUNC) \ - static CMachineInfo const * __cdecl GetInfo() { return &MacInfo; } \ - static CMachineInterface * __cdecl CreateMachine() { return new mi; } \ - void INIT_FUNC() { RegisterMachine(&MacInfo, GetInfo, CreateMachine); } \ - - -#define DLL_EXPORTS_NS(NS, INIT_FUNC) /* namespaced version */ \ - static CMachineInfo const * __cdecl GetInfo() { return &NS::MacInfo; } \ - static CMachineInterface * __cdecl CreateMachine() { return new NS::mi; } \ - void INIT_FUNC() { RegisterMachine(&NS::MacInfo, GetInfo, CreateMachine); } \ - - - -#else - - #define DLL_EXPORTS extern "C" { \ - __declspec(dllexport) CMachineInfo const * __cdecl GetInfo() \ - { \ - return &MacInfo; \ - } \ - __declspec(dllexport) CMachineInterface * __cdecl CreateMachine() \ - { \ - return new mi; \ - } \ - } - -#endif - -#endif \ No newline at end of file Deleted: trunk/OpenMPT/include/audioeffectx.cpp =================================================================== --- trunk/OpenMPT/include/audioeffectx.cpp 2007-11-17 20:42:39 UTC (rev 194) +++ trunk/OpenMPT/include/audioeffectx.cpp 2008-01-12 16:49:50 UTC (rev 195) @@ -1,793 +0,0 @@ -//------------------------------------------------------------------------------------------------------- -// VST Plug-Ins SDK -// Version 2.3 Extension -// \xA9 2003 Steinberg Media Technologies, All Rights Reserved -// -// you should not have to edit this file -// use override methods instead, as suggested in the class declaration (audioeffectx.h) -//------------------------------------------------------------------------------------------------------- - -#ifndef __audioeffectx__ -#include "audioeffectx.h" -#endif - -#ifndef __AEffEditor__ -#include "AEffEditor.hpp" -#endif - -//--------------------------------------------------------------------------------------------- -// 'canDo' strings. note other 'canDos' can be evaluated by calling the according -// function, for instance if getSampleRate returns 0, you -// will certainly want to assume that this selector is not supported. -//--------------------------------------------------------------------------------------------- - -const char* hostCanDos [] = -{ - "sendVstEvents", - "sendVstMidiEvent", - "sendVstTimeInfo", - "receiveVstEvents", - "receiveVstMidiEvent", - "receiveVstTimeInfo", - - "reportConnectionChanges", - "acceptIOChanges", - "sizeWindow", - - "asyncProcessing", - "offline", - "supplyIdle", - "supportShell", // 'shell' handling via uniqueID as suggested by Waves - "openFileSelector" -#if VST_2_2_EXTENSIONS - , - "editFile", - "closeFileSelector" -#endif // VST_2_2_EXTENSIONS -#if VST_2_3_EXTENSIONS - , - "startStopProcess" -#endif // VST_2_3_EXTENSIONS -}; - -const char* plugCanDos [] = -{ - "sendVstEvents", - "sendVstMidiEvent", - "sendVstTimeInfo", - "receiveVstEvents", - "receiveVstMidiEvent", - "receiveVstTimeInfo", - "offline", - "plugAsChannelInsert", - "plugAsSend", - "mixDryWet", - "noRealTime", - "multipass", - "metapass", - "1in1out", - "1in2out", - "2in1out", - "2in2out", - "2in4out", - "4in2out", - "4in4out", - "4in8out", // 4:2 matrix to surround bus - "8in4out", // surround bus to 4:2 matrix - "8in8out" -#if VST_2_1_EXTENSIONS - , - "midiProgramNames", - "conformsToWindowRules" // mac: doesn't mess with grafport. general: may want - // to call sizeWindow (). if you want to use sizeWindow (), - // you must return true (1) in canDo ("conformsToWindowRules") -#endif // VST_2_1_EXTENSIONS - -#if VST_2_3_EXTENSIONS - , - "bypass" -#endif // VST_2_3_EXTENSIONS -}; - -//------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------- -// AudioEffectX extends AudioEffect with the new features. so you should derive -// your plug from AudioEffectX -//------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------------- -// VstEvents + VstTimeInfo -//------------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------------- -AudioEffectX::AudioEffectX (audioMasterCallback audioMaster, long numPrograms, long numParams) - : AudioEffect (audioMaster, numPrograms, numParams) -{ -} - -//------------------------------------------------------------------------------------------------------- -AudioEffectX::~AudioEffectX () -{ -} - -//------------------------------------------------------------------------------------------------------- -long AudioEffectX::dispatcher (long opCode, long index, long value, void *ptr, float opt) -{ - long v = 0; - switch(opCode) - { - // VstEvents - case effProcessEvents: - v = processEvents ((VstEvents*)ptr); - break; - - // parameters and programs - case effCanBeAutomated: - v = canParameterBeAutomated (index) ? 1 : 0; - break; - case effString2Parameter: - v = string2parameter (index, (char*)ptr) ? 1 : 0; - break; - - case effGetNumProgramCategories: - v = getNumCategories (); - break; - case effGetProgramNameIndexed: - v = getProgramNameIndexed (value, index, (char*)ptr) ? 1 : 0; - break; - case effCopyProgram: - v = copyProgram (index) ? 1 : 0; - break; - - // connections, configuration - case effConnectInput: - inputConnected (index, value ? true : false); - v = 1; - break; - case effConnectOutput: - outputConnected (index, value ? true : false); - v = 1; - break; - case effGetInputProperties: - v = getInputProperties (index, (VstPinProperties*)ptr) ? 1 : 0; - break; - case effGetOutputProperties: - v = getOutputProperties (index, (VstPinProperties*)ptr) ? 1 : 0; - break; - case effGetPlugCategory: - v = (long)getPlugCategory (); - break; - - // realtime - case effGetCurrentPosition: - v = reportCurrentPosition (); - break; - - case effGetDestinationBuffer: - v = (long)reportDestinationBuffer (); - break; - - // offline - case effOfflineNotify: - v = offlineNotify ((VstAudioFile*)ptr, value, index != 0); - break; - case effOfflinePrepare: - v = offlinePrepare ((Vs... [truncated message content] |
From: <rel...@us...> - 2008-01-26 20:02:36
|
Revision: 198 http://modplug.svn.sourceforge.net/modplug/?rev=198&view=rev Author: relabsoluness Date: 2008-01-26 12:02:01 -0800 (Sat, 26 Jan 2008) Log Message: ----------- 1.17.02.50 . Few improvements in the volume command handling for plugs Modified Paths: -------------- trunk/OpenMPT/mptrack/bin/mptrack.exe trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/bin/mptrack.exe =================================================================== (Binary files differ) Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2008-01-19 16:37:43 UTC (rev 197) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2008-01-26 20:02:01 UTC (rev 198) @@ -276,8 +276,8 @@ { p->ShowWindow(XMorITorMPT); if(ITorMPT) - p->SetWindowText("0: True to use various IT compatible playback changes\n" - "1: True for old instrument random variation behavior\n" + p->SetWindowText("0: Various playback changes for IT compatibility\n" + "1: Old instrument random variation behavior\n" "2: Plugin volume command bug emulation"); else if(XM) p->SetWindowText("0: Unused\n1: Unused\n2: Plugin volume command bug emulation"); } Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2008-01-19 16:37:43 UTC (rev 197) +++ trunk/OpenMPT/mptrack/mptrack.rc 2008-01-26 20:02:01 UTC (rev 198) @@ -916,8 +916,8 @@ RTEXT "--",IDC_TEXT1,204,62,27,8 GROUPBOX "Pitch/Tempo Lock",IDC_STATIC,364,57,89,25 GROUPBOX "Sample Map",IDC_STATIC,461,27,62,141 - CTEXT "Note Velocity style",IDC_STATIC,374,101,77,10, - SS_CENTERIMAGE,WS_EX_STATICEDGE + CTEXT "Note Velocity",IDC_STATIC,374,101,77,10,SS_CENTERIMAGE, + WS_EX_STATICEDGE CTEXT "Volume command effect",IDC_STATIC,374,133,77,10, SS_CENTERIMAGE,WS_EX_STATICEDGE GROUPBOX "Tuning (experimental)",IDC_STATIC,364,28,92,28 Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2008-01-19 16:37:43 UTC (rev 197) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2008-01-26 20:02:01 UTC (rev 198) @@ -300,7 +300,7 @@ memset(Headers[iIns], 0, sizeof(INSTRUMENTHEADER)); Headers[iIns]->pTuning = m_defaultInstrument.pTuning; Headers[iIns]->nPluginVelocityHandling = PLUGIN_VELOCITYHANDLING_CHANNEL; - Headers[iIns]->nPluginVolumeHandling = PLUGIN_VOLUMEHANDLING_MIDI; + Headers[iIns]->nPluginVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE; memcpy(Headers[iIns]->name, pih->name, 22); if ((nsamples = pih->samples) > 0) Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2008-01-19 16:37:43 UTC (rev 197) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2008-01-26 20:02:01 UTC (rev 198) @@ -2736,7 +2736,7 @@ m_defaultInstrument.nVolEnvReleaseNode=ENV_RELEASE_NODE_UNSET; m_defaultInstrument.wPitchToTempoLock = 0; m_defaultInstrument.pTuning = m_defaultInstrument.s_DefaultTuning; - m_defaultInstrument.nPluginVelocityHandling = PLUGIN_VELOCITYHANDLING_VOLUME; + m_defaultInstrument.nPluginVelocityHandling = PLUGIN_VELOCITYHANDLING_CHANNEL; m_defaultInstrument.nPluginVolumeHandling = PLUGIN_VOLUMEHANDLING_DRYWET; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2008-01-29 21:00:47
|
Revision: 199 http://modplug.svn.sourceforge.net/modplug/?rev=199&view=rev Author: relabsoluness Date: 2008-01-29 13:00:25 -0800 (Tue, 29 Jan 2008) Log Message: ----------- Miscellaneous minor changes . Fix for faulty tabs when switching between modtypes with and without instrumenttab. (http://lpchip.com/modplug/viewtopic.php?t=1614) / Modified flag is not set when sliding tempo/global volume slider for MOD file / When setting instrument pan, checking whether instrument samples have set pan enabled and optionally disabling them. + Unmute all(on transition) shortcutkeys should now work in orderlist context / Disabled Set Pan in sample tab for XM + Half/double pattern rownumber buttons to pattern properties dialog. / Show prev/next pattern now shows pattern over +++ orderlist items. + Channel status in status bar now show channel volume info. / Disabled setting channel pan for MOD/XM in general view. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/Globals.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/OrderToPatternTable.cpp trunk/OpenMPT/mptrack/OrderToPatternTable.h trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/pattern.h trunk/OpenMPT/mptrack/patternContainer.cpp trunk/OpenMPT/mptrack/patternContainer.h trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/mptrack/typedefs.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -80,17 +80,19 @@ BOOL CCtrlGeneral::OnInitDialog() //------------------------------- { + const CModSpecifications specs = m_pSndFile->GetModSpecifications(); CModControlDlg::OnInitDialog(); // Song Title if(m_pSndFile) - m_EditTitle.SetLimitText(m_pSndFile->GetModSpecifications().modNameLengthMax); + m_EditTitle.SetLimitText(specs.modNameLengthMax); else m_EditTitle.SetLimitText(25); // -> CODE#0016 // -> DESC="default tempo update" // m_SpinTempo.SetRange(32, 255); // 255 bpm max - m_SpinTempo.SetRange(32, 512); + //m_SpinTempo.SetRange(32, 512); + m_SpinTempo.SetRange(specs.tempoMin, specs.tempoMax); m_SpinSpeed.SetRange(1, 64); // -! BEHAVIOUR_CHANGE#0016 m_SpinGlobalVol.SetRange(0, 128); @@ -98,7 +100,7 @@ m_SpinVSTiVol.SetRange(0, 2000); m_SpinRestartPos.SetRange(0, 255); - m_SliderTempo.SetRange(0, 480); + m_SliderTempo.SetRange(0, specs.tempoMax - specs.tempoMin); m_SliderGlobalVol.SetRange(0, MAX_SLIDER_GLOBAL_VOL); m_SliderVSTiVol.SetRange(0, MAX_SLIDER_VSTI_VOL); m_SliderSamplePreAmp.SetRange(0, MAX_SLIDER_SAMPLE_VOL); @@ -190,13 +192,17 @@ m_SliderGlobalVol.SetPos(MAX_SLIDER_GLOBAL_VOL-m_pSndFile->m_nDefaultGlobalVolume); m_SliderVSTiVol.SetPos(MAX_SLIDER_VSTI_VOL-m_pSndFile->m_nVSTiVolume); m_SliderSamplePreAmp.SetPos(MAX_SLIDER_SAMPLE_VOL-m_pSndFile->m_nSamplePreAmp); - m_SliderTempo.SetPos(480 - m_pSndFile->m_nDefaultTempo + 32); + m_SliderTempo.SetPos(m_pSndFile->GetModSpecifications().tempoMax - m_pSndFile->m_nDefaultTempo); } if (dwHint & HINT_MODTYPE) { + CModSpecifications specs = m_pSndFile->GetModSpecifications(); + m_SpinTempo.SetRange(specs.tempoMin, specs.tempoMax); + m_SliderTempo.SetRange(0, specs.tempoMax - specs.tempoMin); + BOOL b = TRUE; if (m_pSndFile->m_nType == MOD_TYPE_MOD) b = FALSE; m_EditTempo.EnableWindow(b); @@ -211,6 +217,8 @@ m_SpinSamplePA.EnableWindow(b); m_SliderSamplePreAmp.EnableWindow(b); m_SliderVSTiVol.EnableWindow(b); + //Note: Global volume slider is not disabled for MOD + //on purpose(can be used to control play volume) // MOD Type LPCSTR pszModType = "MOD (ProTracker)"; @@ -258,11 +266,15 @@ CSliderCtrl* pSlider = (CSliderCtrl*) pscroll; if (pSlider==&m_SliderTempo) { - int tempo = 480 - m_SliderTempo.GetPos() + 32; - if ((tempo >= 32) && (tempo <= 512) && (tempo != m_pSndFile->m_nDefaultTempo)) { + int min, max; + m_SpinTempo.GetRange(min, max); + int tempo = max - m_SliderTempo.GetPos(); + if ((tempo >= m_pSndFile->GetModSpecifications().tempoMin) && (tempo <= m_pSndFile->GetModSpecifications().tempoMax) && (tempo != m_pSndFile->m_nDefaultTempo)) { m_pSndFile->m_nDefaultTempo = tempo; m_pSndFile->m_nMusicTempo = tempo; - m_pModDoc->SetModified(); + if(m_pSndFile->GetType() != MOD_TYPE_MOD) + m_pModDoc->SetModified(); + m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); } } @@ -272,7 +284,9 @@ if ((gv >= 0) && (gv <= MAX_SLIDER_GLOBAL_VOL) && (gv != m_pSndFile->m_nDefaultGlobalVolume)) { m_pSndFile->m_nGlobalVolume = gv; m_pSndFile->m_nDefaultGlobalVolume = gv; - m_pModDoc->SetModified(); + if(m_pSndFile->GetType() != MOD_TYPE_MOD) + m_pModDoc->SetModified(); + m_pModDoc->UpdateAllViews(NULL, HINT_MODGENERAL, this); } } @@ -327,7 +341,8 @@ if (s[0]) { UINT n = atoi(s); - if ((n >= 32) && (n <= 512) && (n != m_pSndFile->m_nDefaultTempo)) + CModSpecifications specs = m_pSndFile->GetModSpecifications(); + if ((n >= specs.tempoMin) && (n <= specs.tempoMax) && (n != m_pSndFile->m_nDefaultTempo)) { m_bEditsLocked=true; m_EditTempo.SetModify(FALSE); Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -14,7 +14,7 @@ using std::string; using std::vector; -#pragma warning(disable:4244) +#pragma warning(disable:4244) //conversion from 'type1' to 'type2', possible loss of data const pair<string, WORD> CCtrlInstruments::s_TuningNotFound("Tuning was not found. Setting to default tuning", 7); @@ -1741,9 +1741,44 @@ INSTRUMENTHEADER *penv = m_pSndFile->Headers[m_nInstrument]; if ((!IsLocked()) && (penv)) { - BOOL b = m_CheckPanning.GetCheck(); + const BOOL b = m_CheckPanning.GetCheck(); + if (b) penv->dwFlags |= ENV_SETPANNING; else penv->dwFlags &= ~ENV_SETPANNING; + + if(b && m_pSndFile->GetType() & MOD_TYPE_IT|MOD_TYPE_MPT) + { + bool smpPanningInUse = false; + for(BYTE i = 0; i<ARRAYELEMCOUNT(penv->Keyboard); i++) + { + const SAMPLEINDEX smp = penv->Keyboard[i]; + if(smp <= m_pSndFile->GetNumSamples() && m_pSndFile->Ins[smp].uFlags & CHN_PANNING) + { + smpPanningInUse = true; + break; + } + } + if(smpPanningInUse) + { + if(MessageBox("Some of the samples used in the instrument have \"Set Pan\" enabled. " + "When instrument is played with such sample, sample pan setting overrides instrument pan. " + "Do you wish to disable panning from those samples so that instrument pan setting is effective " + "for the whole instrument?", + "", + MB_YESNO) == IDYES) + { + for(BYTE i = 0; i<ARRAYELEMCOUNT(penv->Keyboard); i++) + { + const SAMPLEINDEX smp = penv->Keyboard[i]; + if(smp <= m_pSndFile->GetNumSamples()) + m_pSndFile->Ins[smp].uFlags &= ~CHN_PANNING; + } + m_pModDoc->SetModified(); + m_pModDoc->UpdateAllViews(NULL, HINT_SAMPLEINFO | HINT_MODTYPE); + } + } + } + // -> CODE#0023 // -> DESC="IT project files (.itp)" m_pSndFile->instrumentModified[m_nInstrument-1] = TRUE; Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -316,7 +316,7 @@ } if (ord != pSndFile->Order[m_nScrollPos]) { - pSndFile->Order[m_nScrollPos] = static_cast<UINT>(ord); + pSndFile->Order[m_nScrollPos] = static_cast<PATTERNINDEX>(ord); m_pModDoc->SetModified(); m_pModDoc->UpdateAllViews(NULL, HINT_MODSEQUENCE, this); InvalidateSelection(); @@ -351,12 +351,17 @@ switch (kc) { - case kcSwitchToOrderList: OnSwitchToView(); return true; + case kcSwitchToOrderList: OnSwitchToView(); return true; case kcChangeLoopStatus: m_pParent->OnModCtrlMsg(CTRLMSG_PAT_LOOP, -1); return true; case kcToggleFollowSong: m_pParent->OnFollowSong(); return true; + + case kcChannelUnmuteAll: + case kcUnmuteAllChnOnPatTransition: + ::PostMessage(m_pParent->GetViewWnd(), WM_MOD_KEYCOMMAND, kc, 0); + return true; } } - //end rewbs.customKeys + //end rewbs.customKeys switch(pMsg->message) @@ -889,7 +894,7 @@ switch(pDropInfo->dwDropType) { case DRAGONDROP_PATTERN: - pSndFile->Order[posdest] = static_cast<UINT>(pDropInfo->dwDropItem); + pSndFile->Order[posdest] = static_cast<PATTERNINDEX>(pDropInfo->dwDropItem); break; case DRAGONDROP_ORDER: @@ -925,4 +930,4 @@ else m_nOrderlistMargins = maxMargins; } return m_nOrderlistMargins; -} +} \ No newline at end of file Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -570,8 +570,8 @@ m_EditGlobalVol.EnableWindow(b); m_SpinGlobalVol.EnableWindow(b); // Panning - b = (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE; - m_CheckPanning.EnableWindow(b); + b = (m_pSndFile->GetType() & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE; + m_CheckPanning.EnableWindow(b && !(m_pSndFile->GetType() & MOD_TYPE_XM)); m_EditPanning.EnableWindow(b); m_SpinPanning.EnableWindow(b); } @@ -599,7 +599,7 @@ // Global Volume SetDlgItemInt(IDC_EDIT8, pins->nGlobalVol); // Panning - CheckDlgButton(IDC_CHECK1, (pins->uFlags & CHN_PANNING) ? MF_CHECKED : 0); + CheckDlgButton(IDC_CHECK1, (pins->uFlags & CHN_PANNING) ? MF_CHECKED : MF_UNCHECKED); //rewbs.fix36944 if (m_pSndFile->m_nType == MOD_TYPE_XM) { SetDlgItemInt(IDC_EDIT9, pins->nPan); //displayed panning with XM is 0-256, just like MPT's internal engine @@ -2236,7 +2236,7 @@ { if (IsLocked()) return; BOOL b = FALSE; - if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) + if (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) { b = IsDlgButtonChecked(IDC_CHECK1); } @@ -2245,14 +2245,14 @@ if (!(m_pSndFile->Ins[m_nSample].uFlags & CHN_PANNING)) { m_pSndFile->Ins[m_nSample].uFlags |= CHN_PANNING; - if (m_pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified(); + m_pModDoc->SetModified(); } } else { if (m_pSndFile->Ins[m_nSample].uFlags & CHN_PANNING) { m_pSndFile->Ins[m_nSample].uFlags &= ~CHN_PANNING; - if (m_pSndFile->m_nType == (MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified(); + m_pModDoc->SetModified(); } } } @@ -2818,7 +2818,7 @@ return CModControlDlg::PreTranslateMessage(pMsg); } -LRESULT CCtrlSamples::OnCustomKeyMsg(WPARAM wParam, LPARAM lParam) +LRESULT CCtrlSamples::OnCustomKeyMsg(WPARAM wParam, LPARAM /*lParam*/) //---------------------------------------------------------------- { if (wParam == kcNull) Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -99,12 +99,14 @@ // CViewPattern Drawing Implementation inline PCPATTERNFONT GetCurrentPatternFont() +//------------------------------------------ { return (CMainFrame::m_dwPatternSetup & PATTERN_SMALLFONT) ? &gSmallPatternFont : &gDefaultPatternFont; } static BYTE hilightcolor(int c0, int c1) +//-------------------------------------- { int cf0, cf1; @@ -510,14 +512,21 @@ UINT nPrevPat = m_nPattern; BOOL bPrevPatFound = FALSE; + // Display previous pattern if (CMainFrame::m_dwPatternSetup & PATTERN_SHOWPREVIOUS) { - UINT nCurOrder = SendCtrlMessage(CTRLMSG_GETCURRENTORDER); - - if ((nCurOrder > 0) && (nCurOrder < pSndFile->Order.size()) && (pSndFile->Order[nCurOrder] == m_nPattern)) + const ORDERINDEX startOrder = static_cast<ORDERINDEX>(SendCtrlMessage(CTRLMSG_GETCURRENTORDER)); + if(startOrder > 0) { - nPrevPat = pSndFile->Order[nCurOrder-1]; - bPrevPatFound = TRUE; + ORDERINDEX prevOrder = startOrder - 1; + //Skip +++ items + while(prevOrder > 0 && pSndFile->Order[prevOrder] == pSndFile->Order.GetIgnoreIndex()) --prevOrder; + + if(startOrder < pSndFile->Order.size() && pSndFile->Order[startOrder] == m_nPattern) + { + nPrevPat = pSndFile->Order[prevOrder]; + bPrevPatFound = TRUE; + } } } if ((bPrevPatFound) && (nPrevPat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[nPrevPat])) @@ -556,11 +565,16 @@ { UINT nNextPat = m_nPattern; BOOL bNextPatFound = FALSE; - UINT nCurOrder = SendCtrlMessage(CTRLMSG_GETCURRENTORDER); - - if ((nCurOrder+1 < pSndFile->Order.size()) && (pSndFile->Order[nCurOrder] == m_nPattern)) + const ORDERINDEX startOrder= static_cast<ORDERINDEX>(SendCtrlMessage(CTRLMSG_GETCURRENTORDER)); + ORDERINDEX nNextOrder = 1 + startOrder; + + //Ignore skip items(+++) from sequence. + const ORDERINDEX ordCount = pSndFile->Order.GetCount(); + while(nNextOrder < ordCount && pSndFile->Order[nNextOrder] == pSndFile->Order.GetIgnoreIndex()) nNextOrder++; + + if ((nNextOrder < ordCount) && (pSndFile->Order[startOrder] == m_nPattern)) { - nNextPat = pSndFile->Order[nCurOrder+1]; + nNextPat = pSndFile->Order[nNextOrder]; bNextPatFound = TRUE; } if ((bNextPatFound) && (nNextPat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[nNextPat])) @@ -1423,6 +1437,7 @@ //rewbs.xinfo void CViewPattern::UpdateXInfoText() +//---------------------------------- { UINT nChn = GetCurrentChannel(); CString xtraInfo; @@ -1434,8 +1449,10 @@ CSoundFile *pSndFile = pModDoc->GetSoundFile(); if (!pSndFile) return; - xtraInfo.Format("Chan: %d; macro: %X; cutoff: %X; reso: %X; pan: %X", + //xtraInfo.Format("Chan: %d; macro: %X; cutoff: %X; reso: %X; pan: %X", + xtraInfo.Format("Chn:%d; Vol:%X; Mac:%X; Cut:%X; Res:%X; Pan:%X", nChn+1, + pSndFile->Chn[nChn].nGlobalVol, pSndFile->Chn[nChn].nActiveMacro, pSndFile->Chn[nChn].nCutOff, pSndFile->Chn[nChn].nResonance, Modified: trunk/OpenMPT/mptrack/Globals.cpp =================================================================== --- trunk/OpenMPT/mptrack/Globals.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/Globals.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -289,9 +289,39 @@ { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CModControlDlg *pDlg = NULL; - UINT nID; + if (nIndex == -1) nIndex = m_TabCtrl.GetCurSel(); + + const UINT nID = m_TabCtrl.GetItemData(nIndex); + if(nID == 0) return FALSE; + + switch(nID) + { + //rewbs.graph + case IDD_CONTROL_GRAPH: + nIndex = 5; + break; + //end rewbs.graph + case IDD_CONTROL_COMMENTS: + nIndex = 4; + break; + case IDD_CONTROL_GLOBALS: + nIndex = 0; + break; + case IDD_CONTROL_PATTERNS: + nIndex = 1; + break; + case IDD_CONTROL_SAMPLES: + nIndex = 2; + break; + case IDD_CONTROL_INSTRUMENTS: + nIndex = 3; + break; + default: + return FALSE; + } + if ((nIndex < 0) || (nIndex >= MAX_PAGES) || (!pMainFrm)) return FALSE; //rewbs.varWindowSize @@ -304,7 +334,6 @@ PostMessage(WM_MOD_CTRLMSG, CTRLMSG_ACTIVATEPAGE, lParam); return TRUE; } - if ((nID = m_TabCtrl.GetItemData(nIndex)) == 0) return FALSE; if ((m_nActiveDlg >= 0) && (m_nActiveDlg < MAX_PAGES)) { if (m_Pages[m_nActiveDlg]) @@ -314,11 +343,11 @@ } m_nActiveDlg = -1; } - if (m_Pages[nIndex]) + if (m_Pages[nIndex]) //Ctrl window already created? { m_nActiveDlg = nIndex; pDlg = m_Pages[nIndex]; - } else + } else //Ctrl window is not created yet - creating one. { switch(nID) { Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -192,18 +192,13 @@ static void ShowChangesDialog() //----------------------------- { + /* CString firstOpenMessage = "OpenMPT version " + CMainFrame::GetFullVersionString(); firstOpenMessage += ". This is a development build.\n\nChanges:\n\n" - "[New] Ability to control plug params with MIDI controllers.\n" - "[New] Ability to pass MIDI to plugin.\n" - "[Imp] Ability to take MIDI volume into account when playing notes.\n" - "[Fix/Imp] Plugin volume command fix. In addition now there are options how to interpret it.\n" - "[Imp] Keyshortcut for preset navigation jumps in VST editor.\n" - "[Mod] .bak files won't be shown in load dialog with 'All modules' filter.\n" - "[Fix/Mod] Instrument random variation fix/behavior change.\n\n" - "And various other fixes and changes."; + "TODO"; CMainFrame::GetMainFrame()->MessageBox(firstOpenMessage, "OpenMPT v." + CMainFrame::GetFullVersionString(), MB_ICONINFORMATION); + */ } Modified: trunk/OpenMPT/mptrack/OrderToPatternTable.cpp =================================================================== --- trunk/OpenMPT/mptrack/OrderToPatternTable.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/OrderToPatternTable.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -89,10 +89,34 @@ } -PATTERNINDEX COrderToPatternTable::GetInvalidPatIndex() const {return m_rSndFile.GetType() == MOD_TYPE_MPT ? 65535 : 0xFF;} -PATTERNINDEX COrderToPatternTable::GetIgnoreIndex() const {return m_rSndFile.GetType() == MOD_TYPE_MPT ? 65534 : 0xFE;} +void COrderToPatternTable::OnModTypeChanged(const MODTYPE oldtype) +//---------------------------------------------------------------- +{ + const CModSpecifications specs = m_rSndFile.GetModSpecifications(); + //Resize orderlist if needed. Because old orderlist had 256 elements, not making it + //smaller than that even if the modtype doesn't support that many orders. + if(specs.ordersMax < GetCount()) + { + resize(max(MAX_PATTERNS, specs.ordersMax)); + for(ORDERINDEX i = GetCount(); i>specs.ordersMax; --i) (*this)[i-1] = GetInvalidPatIndex(); + } + //Replace items used to denote end of song/skip order. + replace(begin(), end(), GetInvalidPatIndex(oldtype), GetInvalidPatIndex()); + replace(begin(), end(), GetIgnoreIndex(oldtype), GetIgnoreIndex()); +} + + +PATTERNINDEX COrderToPatternTable::GetInvalidPatIndex(const MODTYPE type) {return type == MOD_TYPE_MPT ? 65535 : 0xFF;} +PATTERNINDEX COrderToPatternTable::GetIgnoreIndex(const MODTYPE type) {return type == MOD_TYPE_MPT ? 65534 : 0xFE;} + +PATTERNINDEX COrderToPatternTable::GetInvalidPatIndex() const {return GetInvalidPatIndex(m_rSndFile.GetType());} +PATTERNINDEX COrderToPatternTable::GetIgnoreIndex() const {return GetIgnoreIndex(m_rSndFile.GetType());} + + + + //-------------------------------------------------- //-------------------------------------------------- //-------------------------------------------------- @@ -131,3 +155,5 @@ } } + + Modified: trunk/OpenMPT/mptrack/OrderToPatternTable.h =================================================================== --- trunk/OpenMPT/mptrack/OrderToPatternTable.h 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/OrderToPatternTable.h 2008-01-29 21:00:25 UTC (rev 199) @@ -32,14 +32,21 @@ size_t WriteToByteArray(BYTE* dest, const UINT numOfBytes, const UINT destSize); + ORDERINDEX GetCount() const {return static_cast<ORDERINDEX>(size());} + //Deprecated function used for MPTm's created in 1.17.02.46 - 1.17.02.48. DWORD Unserialize(const BYTE* const src, const DWORD memLength); //Returns true if the IT orderlist datafield is not sufficient to store orderlist information. bool NeedsExtraDatafield() const; + void OnModTypeChanged(const MODTYPE oldtype); + PATTERNINDEX GetInvalidPatIndex() const; //To correspond 0xFF + static PATTERNINDEX GetInvalidPatIndex(const MODTYPE type); + PATTERNINDEX GetIgnoreIndex() const; //To correspond 0xFE + static PATTERNINDEX GetIgnoreIndex(const MODTYPE type); COrderSerialization* NewReadWriteObject() {return new COrderSerialization(*this);} Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -318,7 +318,8 @@ m_TabCtrl.DeleteAllItems(); for (int iItem=0; iItem<nTabCount; iItem++) { - wsprintf(s, "%d - %d", iItem * 4 + 1, iItem * 4 + 4); + const int lastItem = min(iItem * 4 + 4, MAX_BASECHANNELS); + wsprintf(s, "%d - %d", iItem * 4 + 1, lastItem); tci.mask = TCIF_TEXT | TCIF_PARAM; tci.pszText = s; tci.lParam = iItem * 4; @@ -337,58 +338,65 @@ m_nActiveTab = nTabIndex; for (int ichn=0; ichn<4; ichn++) { - UINT nChn = nTabIndex*4+ichn; - BOOL bEnable = (nChn < pSndFile->m_nChannels) ? TRUE : FALSE; - // Text - s[0] = 0; - if (bEnable) wsprintf(s, "Channel %d", nChn+1); - SetDlgItemText(IDC_TEXT1+ichn, s); - // Mute - CheckDlgButton(IDC_CHECK1+ichn*2, (pSndFile->ChnSettings[nChn].dwFlags & CHN_MUTE) ? TRUE : FALSE); - // Surround - CheckDlgButton(IDC_CHECK2+ichn*2, (pSndFile->ChnSettings[nChn].dwFlags & CHN_SURROUND) ? TRUE : FALSE); - // Volume - int vol = pSndFile->ChnSettings[nChn].nVolume; - m_sbVolume[ichn].SetPos(vol); - SetDlgItemInt(IDC_EDIT1+ichn*2, vol); - // Pan - int pan = pSndFile->ChnSettings[nChn].nPan; - m_sbPan[ichn].SetPos(pan/4); - SetDlgItemInt(IDC_EDIT2+ichn*2, pan); - memcpy(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME); - s[MAX_CHANNELNAME-1] = 0; - SetDlgItemText(IDC_EDIT9+ichn, s); - // Channel effect - m_CbnEffects[ichn].SetRedraw(FALSE); - m_CbnEffects[ichn].ResetContent(); - m_CbnEffects[ichn].SetItemData(m_CbnEffects[ichn].AddString("No plugin"), 0); - int fxsel = 0; - for (UINT ifx=0; ifx<MAX_MIXPLUGINS; ifx++) + const UINT nChn = nTabIndex*4+ichn; + const BOOL bEnable = (nChn < pSndFile->GetNumChannels()) ? TRUE : FALSE; + if(nChn < MAX_BASECHANNELS) { - if ((pSndFile->m_MixPlugins[ifx].Info.dwPluginId1) - || (pSndFile->m_MixPlugins[ifx].Info.dwPluginId2) - || (pSndFile->m_MixPlugins[ifx].Info.szName[0] - || (pSndFile->ChnSettings[nChn].nMixPlugin == ifx+1))) + // Text + s[0] = 0; + if (bEnable) wsprintf(s, "Channel %d", nChn+1); + SetDlgItemText(IDC_TEXT1+ichn, s); + // Mute + CheckDlgButton(IDC_CHECK1+ichn*2, (pSndFile->ChnSettings[nChn].dwFlags & CHN_MUTE) ? TRUE : FALSE); + // Surround + CheckDlgButton(IDC_CHECK2+ichn*2, (pSndFile->ChnSettings[nChn].dwFlags & CHN_SURROUND) ? TRUE : FALSE); + // Volume + int vol = pSndFile->ChnSettings[nChn].nVolume; + m_sbVolume[ichn].SetPos(vol); + SetDlgItemInt(IDC_EDIT1+ichn*2, vol); + // Pan + int pan = pSndFile->ChnSettings[nChn].nPan; + m_sbPan[ichn].SetPos(pan/4); + SetDlgItemInt(IDC_EDIT2+ichn*2, pan); + memcpy(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME); + s[MAX_CHANNELNAME-1] = 0; + SetDlgItemText(IDC_EDIT9+ichn, s); + // Channel effect + m_CbnEffects[ichn].SetRedraw(FALSE); + m_CbnEffects[ichn].ResetContent(); + m_CbnEffects[ichn].SetItemData(m_CbnEffects[ichn].AddString("No plugin"), 0); + int fxsel = 0; + for (UINT ifx=0; ifx<MAX_MIXPLUGINS; ifx++) { - wsprintf(s, "FX%d: %s", ifx+1, pSndFile->m_MixPlugins[ifx].Info.szName); - int n = m_CbnEffects[ichn].AddString(s); - m_CbnEffects[ichn].SetItemData(n, ifx+1); - if (pSndFile->ChnSettings[nChn].nMixPlugin == ifx+1) fxsel = n; + if ((pSndFile->m_MixPlugins[ifx].Info.dwPluginId1) + || (pSndFile->m_MixPlugins[ifx].Info.dwPluginId2) + || (pSndFile->m_MixPlugins[ifx].Info.szName[0] + || (pSndFile->ChnSettings[nChn].nMixPlugin == ifx+1))) + { + wsprintf(s, "FX%d: %s", ifx+1, pSndFile->m_MixPlugins[ifx].Info.szName); + int n = m_CbnEffects[ichn].AddString(s); + m_CbnEffects[ichn].SetItemData(n, ifx+1); + if (pSndFile->ChnSettings[nChn].nMixPlugin == ifx+1) fxsel = n; + } } + m_CbnEffects[ichn].SetRedraw(TRUE); + m_CbnEffects[ichn].SetCurSel(fxsel); } - m_CbnEffects[ichn].SetRedraw(TRUE); - m_CbnEffects[ichn].SetCurSel(fxsel); + else + SetDlgItemText(IDC_TEXT1+ichn, ""); + // Enable/Disable controls for this channel BOOL bIT = ((bEnable) && (pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_CHECK1+ichn*2), bEnable); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_CHECK2+ichn*2), bIT); ::EnableWindow(m_sbVolume[ichn].m_hWnd, bEnable); - ::EnableWindow(m_sbPan[ichn].m_hWnd, bEnable); + ::EnableWindow(m_sbPan[ichn].m_hWnd, bEnable && !(pSndFile->GetType() & MOD_TYPE_XM|MOD_TYPE_MOD)); ::EnableWindow(m_spinVolume[ichn], bEnable); - ::EnableWindow(m_spinPan[ichn], bEnable); + ::EnableWindow(m_spinPan[ichn], bEnable && !(pSndFile->GetType() & MOD_TYPE_XM|MOD_TYPE_MOD)); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT1+ichn*2), bEnable); - ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT2+ichn*2), bEnable); + ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT2+ichn*2), bEnable && !(pSndFile->GetType() & MOD_TYPE_XM|MOD_TYPE_MOD)); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT9+ichn), ((bEnable) && (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)))); + m_CbnEffects[ichn].EnableWindow(bEnable); } UnlockControls(); } @@ -1622,7 +1630,7 @@ } // Update all other plugs' outputs - for (int nPlug=0; nPlug<src; nPlug++) { + for (PLUGINDEX nPlug=0; nPlug<src; nPlug++) { if (pSndFile->m_MixPlugins[nPlug].Info.dwOutputRouting & 0x80) { if ((pSndFile->m_MixPlugins[nPlug].Info.dwOutputRouting & 0x7f) == src) { pSndFile->m_MixPlugins[nPlug].Info.dwOutputRouting = ((BYTE)dest)|0x80; @@ -1630,14 +1638,14 @@ } } // Update channels - for (int nChn=0; nChn<pSndFile->m_nChannels; nChn++) { + for (CHANNELINDEX nChn=0; nChn<pSndFile->m_nChannels; nChn++) { if (pSndFile->ChnSettings[nChn].nMixPlugin == src+1) { pSndFile->ChnSettings[nChn].nMixPlugin = dest+1; } } // Update instruments - for (int nIns=1; nIns<=pSndFile->m_nInstruments; nIns++) { + for (INSTRUMENTINDEX nIns=1; nIns<=pSndFile->m_nInstruments; nIns++) { if (pSndFile->Headers[nIns] && (pSndFile->Headers[nIns]->nMixPlug == src+1)) { pSndFile->Headers[nIns]->nMixPlug = dest+1; } Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -2910,10 +2910,10 @@ const BYTE nByte1 = GetFromMIDIMsg_DataByte1(dwMidiData); const BYTE nByte2 = GetFromMIDIMsg_DataByte2(dwMidiData); - const BYTE nNote = nByte1 + 1; // +1 is for MPT, where middle C is 61 - int nVol = nByte2; // At this stage nVol is a non linear value in [0;127] + const BYTE nNote = nByte1 + 1; // +1 is for MPT, where middle C is 61 + int nVol = nByte2; // At this stage nVol is a non linear value in [0;127] // Need to convert to linear in [0;64] - see below - BYTE event = GetFromMIDIMsg_Event(dwMidiData); + BYTE event = GetFromMIDIMsg_Event(dwMidiData); if ((event == 0x9) && !nVol) event = 0x8; //Convert event to note-off if req'd @@ -3241,7 +3241,7 @@ case kcChannelMute: OnMuteChannel(true); return wParam; case kcChannelSolo: OnSoloChannel(true); return wParam; case kcChannelUnmuteAll: OnUnmuteAll(); return wParam; - case kcToggleChanMuteOnPatTransition: TogglePendingMute((m_dwCursor&0xFFFF)>>3); return wParam; + case kcToggleChanMuteOnPatTransition: TogglePendingMute(GetChanFromCursor(m_dwCursor)); return wParam; case kcUnmuteAllChnOnPatTransition: OnPendingUnmuteAllChnFromClick(); return wParam; case kcTimeAtRow: OnShowTimeAtRow(); return wParam; case kcSoloChnOnPatTransition: PendingSoloChn(GetCurrentChannel()); return wParam; @@ -3701,8 +3701,7 @@ return; CSoundFile *pSndFile = pModDoc->GetSoundFile(); - MODCOMMAND *p = pSndFile->Patterns[m_nPattern], *prowbase; - UINT nChn = (m_dwCursor & 0xFFFF) >> 3; + UINT nChn = GetChanFromCursor(m_dwCursor); PrepareUndo(m_dwBeginSel, m_dwEndSel); BYTE* activeNoteMap = isSplit ? splitActiveNoteChannel : activeNoteChannel; @@ -3725,11 +3724,7 @@ //Work out where to put the note off UINT nRow = usePlaybackPosition ? pSndFile->m_nRow : m_nRow; - prowbase = p + nRow * pSndFile->m_nChannels; - if (releaseChan < pSndFile->GetNumChannels()) - p=prowbase+releaseChan; - else - p=prowbase+nChn; + MODCOMMAND* p = pSndFile->Patterns[m_nPattern].GetpModCommand(nRow, (releaseChan < pSndFile->GetNumChannels()) ? releaseChan : nChn); //don't overwrite: if (p->note || p->instr || p->volcmd) { @@ -3802,8 +3797,7 @@ return; CSoundFile *pSndFile = pModDoc->GetSoundFile(); - MODCOMMAND *p = pSndFile->Patterns[m_nPattern], *prowbase; - UINT nChn = (m_dwCursor & 0xFFFF) >> 3; + UINT nChn = GetChanFromCursor(m_dwCursor); PrepareUndo(m_dwBeginSel, m_dwEndSel); BYTE* activeNoteMap = isSplit ? splitActiveNoteChannel : activeNoteChannel; @@ -3816,9 +3810,7 @@ if (!(CMainFrame::m_dwPatternSetup&PATTERN_KBDNOTEOFF )) return; - //Work out where to put the note off - prowbase = p + m_nRow * pSndFile->m_nChannels; - p=prowbase+nChn; + MODCOMMAND* p = pSndFile->Patterns[m_nPattern].GetpModCommand(m_nRow, nChn); //don't overwrite: if (p->note) @@ -3863,15 +3855,11 @@ { CSoundFile *pSndFile = pModDoc->GetSoundFile(); - MODCOMMAND *p = pSndFile->Patterns[m_nPattern], *prowbase; - MODCOMMAND oldcmd; // This is the command we are about to overwrite - UINT nChn = (m_dwCursor & 0xFFFF) >> 3; + UINT nChn = GetChanFromCursor(m_dwCursor); PrepareUndo(m_dwBeginSel, m_dwEndSel); - // -- Work out where to put the new oct - prowbase = p + m_nRow * pSndFile->m_nChannels; - p = prowbase + nChn; - oldcmd = *p; + MODCOMMAND* p = pSndFile->Patterns[m_nPattern].GetpModCommand(m_nRow, nChn); + MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite if (oldcmd.note) TempEnterNote(((oldcmd.note-1)%12)+val*12+1); } Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -844,6 +844,11 @@ ///////////////////////////////////////////////////////////////////////////////////////////// // CPatternPropertiesDlg +BEGIN_MESSAGE_MAP(CPatternPropertiesDlg, CDialog) + ON_COMMAND(IDC_BUTTON_HALF, OnHalfRowNumber) + ON_COMMAND(IDC_BUTTON_DOUBLE, OnDoubleRowNumber) +END_MESSAGE_MAP() + BOOL CPatternPropertiesDlg::OnInitDialog() //---------------------------------------- { @@ -871,13 +876,50 @@ wsprintf(s, "Pattern #%d:\x0d\x0a %d rows (%dK)", m_nPattern, pSndFile->PatternSize[m_nPattern], - (pSndFile->PatternSize[m_nPattern] * pSndFile->m_nChannels * 6)/1024); + (pSndFile->PatternSize[m_nPattern] * pSndFile->m_nChannels * sizeof(MODCOMMAND))/1024); SetDlgItemText(IDC_TEXT1, s); } return TRUE; } +void CPatternPropertiesDlg::OnHalfRowNumber() +//------------------------------------------- +{ + CComboBox *combo; + CString str; + combo = (CComboBox *)GetDlgItem(IDC_COMBO1); + if(combo->GetCount() < 1) return; + if(combo->GetCurSel() == CB_ERR) combo->SetCurSel(0); + + combo->GetLBText(combo->GetCurSel(), str); + int sel = atoi(str)/2; + combo->GetLBText(0, str); + const int row0 = atoi(str); + if(sel < row0) sel = row0; + combo->SetCurSel(sel - row0); +} + + +void CPatternPropertiesDlg::OnDoubleRowNumber() +//--------------------------------------------- +{ + CComboBox *combo; + CString str; + combo = (CComboBox *)GetDlgItem(IDC_COMBO1); + if(combo->GetCount() < 1) return; + if(combo->GetCurSel() == CB_ERR) combo->SetCurSel(0); + + combo->GetLBText(combo->GetCurSel(), str); + int sel = 2*atoi(str); + combo->GetLBText(0, str); + const int row0 = atoi(str); + combo->GetLBText(combo->GetCount()-1, str); + if(sel > atoi(str)) sel = atoi(str); + combo->SetCurSel(sel - row0); +} + + void CPatternPropertiesDlg::OnOK() //-------------------------------- { Modified: trunk/OpenMPT/mptrack/dlg_misc.h =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.h 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/dlg_misc.h 2008-01-29 21:00:25 UTC (rev 199) @@ -159,6 +159,9 @@ protected: virtual BOOL OnInitDialog(); virtual void OnOK(); + afx_msg void OnHalfRowNumber(); + afx_msg void OnDoubleRowNumber(); + DECLARE_MESSAGE_MAP() }; Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/mptrack.rc 2008-01-29 21:00:25 UTC (rev 199) @@ -1239,6 +1239,8 @@ LTEXT "Pattern Info",IDC_TEXT1,10,36,95,25 DEFPUSHBUTTON "OK",IDOK,115,4,50,14 PUSHBUTTON "Cancel",IDCANCEL,115,22,50,14 + PUSHBUTTON "/2",IDC_BUTTON_HALF,117,47,21,14 + PUSHBUTTON "x2",IDC_BUTTON_DOUBLE,144,47,21,14 END IDD_PATTERN_EDITCOMMAND DIALOGEX 0, 0, 214, 65 @@ -1945,7 +1947,7 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,17,2,50 + FILEVERSION 1,17,2,51 PRODUCTVERSION 0,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG @@ -1963,7 +1965,7 @@ BEGIN VALUE "CompanyName", "Olivier Lapicque / OpenMPT team" VALUE "FileDescription", "OpenMPT / ModPlug Tracker" - VALUE "FileVersion", "1, 17, 2, 50" + VALUE "FileVersion", "1, 17, 2, 51" VALUE "InternalName", "Modplug Tracker" VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2007 GPL." VALUE "LegalTrademarks", "M.O.D.P.L.U.G" Modified: trunk/OpenMPT/mptrack/pattern.h =================================================================== --- trunk/OpenMPT/mptrack/pattern.h 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/pattern.h 2008-01-29 21:00:25 UTC (rev 199) @@ -31,8 +31,8 @@ //BEGIN: INTERFACE METHODS public: - MODCOMMAND* GetpModCommand(const UINT r, const UINT c) {return &m_ModCommands[r*GetNumChannels()+c];} - const MODCOMMAND* GetpModCommand(const UINT r, const UINT c) const {return &m_ModCommands[r*GetNumChannels()+c];} + MODCOMMAND* GetpModCommand(const ROWINDEX r, const CHANNELINDEX c) {return &m_ModCommands[r*GetNumChannels()+c];} + const MODCOMMAND* GetpModCommand(const ROWINDEX r, const CHANNELINDEX c) const {return &m_ModCommands[r*GetNumChannels()+c];} ROWINDEX GetNumRows() const {return m_Rows;} Modified: trunk/OpenMPT/mptrack/patternContainer.cpp =================================================================== --- trunk/OpenMPT/mptrack/patternContainer.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/patternContainer.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -6,10 +6,10 @@ int CPatternContainer::Insert(const ROWINDEX rows) //--------------------------------------------- { - size_t i = 0; + PATTERNINDEX i = 0; for(i = 0; i<m_Patterns.size(); i++) if(!m_Patterns[i]) break; - if(Insert(static_cast<WORD>(i), rows)) + if(Insert(i, rows)) return -1; else return i; @@ -20,7 +20,7 @@ //--------------------------------------------------------------- { const CModSpecifications& specs = m_rSndFile.GetModSpecifications(); - if(index > m_Patterns.size() || rows > specs.patternRowsMax) + if(index >= specs.patternsMax || index > m_Patterns.size() || rows > specs.patternRowsMax) return true; if(index < m_Patterns.size() && m_Patterns[index]) return true; @@ -75,3 +75,13 @@ m_Patterns.resize(newSize, MODPATTERN(*this)); } } + + +void CPatternContainer::OnModTypeChanged(const MODTYPE /*oldtype*/) +//---------------------------------------------------------- +{ + const CModSpecifications specs = m_rSndFile.GetModSpecifications(); + if(specs.patternsMax < Size()) ResizeArray(max(MAX_PATTERNS, specs.patternsMax)); + else if(Size() < MAX_PATTERNS) ResizeArray(MAX_PATTERNS); +} + Modified: trunk/OpenMPT/mptrack/patternContainer.h =================================================================== --- trunk/OpenMPT/mptrack/patternContainer.h 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/patternContainer.h 2008-01-29 21:00:25 UTC (rev 199) @@ -54,6 +54,8 @@ void ResizeArray(const PATTERNINDEX newSize); + void OnModTypeChanged(const MODTYPE oldtype); + //END: INTERFACE METHODS Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/resource.h 2008-01-29 21:00:25 UTC (rev 199) @@ -810,6 +810,8 @@ #define IDC_EDIT_FLAGS 2323 #define IDC_CHECKCAPTURE 2324 #define IDC_SPINMOVEMAPPING 2325 +#define IDC_BUTTON_HALF 2326 +#define IDC_BUTTON_DOUBLE 2327 #define ID_FILE_NEWMOD 32771 #define ID_FILE_NEWXM 32772 #define ID_FILE_NEWS3M 32773 @@ -1032,7 +1034,7 @@ #define ID_Menu59207 59207 #define ID_ENVELOPE_SCALEPOINTS 59208 #define ID_NETLINK_OPENMPTWIKI 59210 -#define ID_VIEW_MIDIMAPPING 59211 +#define ID_VIEW_MIDIMAPPING 59211 // Next default values for new objects // @@ -1041,7 +1043,7 @@ #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 516 #define _APS_NEXT_COMMAND_VALUE 59212 -#define _APS_NEXT_CONTROL_VALUE 2326 +#define _APS_NEXT_CONTROL_VALUE 2328 #define _APS_NEXT_SYMED_VALUE 901 #endif #endif Modified: trunk/OpenMPT/mptrack/typedefs.h =================================================================== --- trunk/OpenMPT/mptrack/typedefs.h 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/mptrack/typedefs.h 2008-01-29 21:00:25 UTC (rev 199) @@ -39,6 +39,7 @@ typedef uint16 TEMPO; typedef uint16 SAMPLEINDEX; typedef uint16 INSTRUMENTINDEX; +typedef uint32 MODTYPE; const ORDERINDEX ORDERINDEX_MAX = (std::numeric_limits<ORDERINDEX>::max)(); const ROWINDEX ROWINDEX_MAX = (std::numeric_limits<ROWINDEX>::max)(); Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -1105,13 +1105,14 @@ { dwMemPos += LoadMixPlugins(lpStream+dwMemPos, dwMemLength-dwMemPos); } - // Checking for unused channels + //UINT npatterns = pifh->patnum; UINT npatterns = patpos.size(); if (npatterns > GetModSpecifications().patternsMax) npatterns = GetModSpecifications().patternsMax; + // Checking for unused channels for (UINT patchk=0; patchk<npatterns; patchk++) { memset(chnmask, 0, sizeof(chnmask)); @@ -1331,6 +1332,8 @@ LoadExtendedSongProperties(GetType(), ptr, lpStream, mptStartPos); } + Patterns.ResizeArray(max(MAX_PATTERNS, npatterns)); + // Reading Patterns for (UINT npat=0; npat<npatterns; npat++) { @@ -1338,8 +1341,10 @@ { if(Patterns.Insert(npat, 64)) { - MessageBox(NULL, "Error occured while loading file, error code 1101080209", "", MB_ICONERROR); - return FALSE; + CString s; + s.Format("Allocating patterns failed starting from pattern %u", npat); + MessageBox(NULL, s, "", MB_ICONERROR); + break; } continue; } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2008-01-29 21:00:25 UTC (rev 199) @@ -1534,11 +1534,11 @@ if(chnFrom == chnTo) return false; if(chnFrom >= m_nChannels || chnTo >= m_nChannels) { - CString str = "Error: Bad move indexes in CSoundFile::MoveChannel(...)"; - CMainFrame::GetMainFrame()->MessageBox(str , "MoveChannel(...)", MB_OK | MB_ICONINFORMATION); - return true; + CString str = "Error: Bad move indexes in CSoundFile::MoveChannel(...)"; + CMainFrame::GetMainFrame()->MessageBox(str , "MoveChannel(...)", MB_OK | MB_ICONINFORMATION); + return true; } - std::vector<CHANNELINDEX> newOrder; + vector<CHANNELINDEX> newOrder; //First creating new order identical to current order... for(CHANNELINDEX i = 0; i<GetNumChannels(); i++) { @@ -2913,27 +2913,16 @@ //--------------------------------------------------- { const MODTYPE oldtype = m_nType; - const PATTERNINDEX oldInvalidIndex = Order.GetInvalidPatIndex(); - const PATTERNINDEX oldIgnoreIndex = Order.GetIgnoreIndex(); m_nType = newType; SetModSpecsPointer(m_pModSpecs, m_nType); m_ModFlags = m_ModFlags & GetModFlagMask(oldtype, newType); - - const CModSpecifications& specs = GetModSpecifications(); - if(specs.ordersMax < Order.size()) - { - Order.resize(max(MAX_PATTERNS, specs.ordersMax)); - for(ORDERINDEX i = Order.size(); i>specs.ordersMax; --i) Order[i-1] = Order.GetInvalidPatIndex(); - } - replace(Order.begin(), Order.end(), oldInvalidIndex, Order.GetInvalidPatIndex()); - replace(Order.begin(), Order.end(), oldIgnoreIndex, Order.GetIgnoreIndex()); - if(specs.patternsMax < Patterns.Size()) Patterns.ResizeArray(specs.patternsMax); - else if(Patterns.Size() < MAX_PATTERNS) Patterns.ResizeArray(MAX_PATTERNS); - + Order.OnModTypeChanged(oldtype); + Patterns.OnModTypeChanged(oldtype); } + bool CSoundFile::SetTitle(const char* titleCandidate, size_t strSize) //------------------------------------------------------------------- { Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/soundlib/Sndfile.h 2008-01-29 21:00:25 UTC (rev 199) @@ -819,7 +819,6 @@ const BYTE MSF_OLDVOLSWING = 1; //IT/MPT const BYTE MSF_MIDICC_BUGEMULATION = 2; //IT/MPT/XM -typedef UINT MODTYPE; class CTuningCollection; @@ -965,7 +964,7 @@ //Return the number of channels in the pattern. In 1.17.02.45 //it returned the number of channels with volume != 0 - CHANNELINDEX GetNumChannels() const {return static_cast<CHANNELINDEX>(m_nChannels);} + CHANNELINDEX GetNumChannels() const {return static_cast<CHANNELINDEX>(m_nChannels);} BOOL SetMasterVolume(UINT vol, BOOL bAdjustAGC=FALSE); UINT GetMasterVolume() const { return m_nMasterVolume; } @@ -980,7 +979,7 @@ UINT GetMaxPosition() const; IMixPlugin* GetInstrumentPlugin(INSTRUMENTINDEX instr); - const CModSpecifications& GetModSpecifications() {return *m_pModSpecs;} + const CModSpecifications& GetModSpecifications() const {return *m_pModSpecs;} static const CModSpecifications& GetModSpecifications(const MODTYPE type); double GetCurrentBPM() const; @@ -1013,7 +1012,7 @@ void CheckCPUUsage(UINT nCPU); BOOL SetPatternName(UINT nPat, LPCSTR lpszName); BOOL GetPatternName(UINT nPat, LPSTR lpszName, UINT cbSize=MAX_PATTERNNAME) const; - CHANNELINDEX ReArrangeChannels(const std::vector<CHANNELINDEX>& fromToArray); + CHANNELINDEX ReArrangeChannels(const vector<CHANNELINDEX>& fromToArray); bool MoveChannel(UINT chn_from, UINT chn_to); bool InitChannel(UINT nch); Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2008-01-26 20:02:01 UTC (rev 198) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2008-01-29 21:00:25 UTC (rev 199) @@ -176,7 +176,7 @@ //TODO: Set correct values. "it", //File extension 240, //Pattern max. - 256, //Order max. + 200, //Order max. 4, //Channel min 64, //Channel max 32, //Min tempo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2008-02-02 19:03:45
|
Revision: 200 http://modplug.svn.sourceforge.net/modplug/?rev=200&view=rev Author: relabsoluness Date: 2008-02-02 11:03:19 -0800 (Sat, 02 Feb 2008) Log Message: ----------- . Extended song/instrument properties were not always loaded correctly for IT(http://lpchip.com/modplug/viewtopic.php?p=16335) . Channel pan controls in general view were disable for all types instead of just XM and MOD (bug introduced in rev. 199) Modified Paths: -------------- trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2008-01-29 21:00:25 UTC (rev 199) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2008-02-02 19:03:19 UTC (rev 200) @@ -390,11 +390,11 @@ ::EnableWindow(::GetDlgItem(m_hWnd, IDC_CHECK1+ichn*2), bEnable); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_CHECK2+ichn*2), bIT); ::EnableWindow(m_sbVolume[ichn].m_hWnd, bEnable); - ::EnableWindow(m_sbPan[ichn].m_hWnd, bEnable && !(pSndFile->GetType() & MOD_TYPE_XM|MOD_TYPE_MOD)); + ::EnableWindow(m_sbPan[ichn].m_hWnd, bEnable && !(pSndFile->GetType() & (MOD_TYPE_XM|MOD_TYPE_MOD))); ::EnableWindow(m_spinVolume[ichn], bEnable); - ::EnableWindow(m_spinPan[ichn], bEnable && !(pSndFile->GetType() & MOD_TYPE_XM|MOD_TYPE_MOD)); + ::EnableWindow(m_spinPan[ichn], bEnable && !(pSndFile->GetType() & (MOD_TYPE_XM|MOD_TYPE_MOD))); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT1+ichn*2), bEnable); - ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT2+ichn*2), bEnable && !(pSndFile->GetType() & MOD_TYPE_XM|MOD_TYPE_MOD)); + ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT2+ichn*2), bEnable && !(pSndFile->GetType() & (MOD_TYPE_XM|MOD_TYPE_MOD))); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_EDIT9+ichn), ((bEnable) && (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)))); m_CbnEffects[ichn].EnableWindow(bEnable); } Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2008-01-29 21:00:25 UTC (rev 199) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2008-02-02 19:03:19 UTC (rev 200) @@ -958,6 +958,8 @@ } } + if(GetType() == MOD_TYPE_IT) mptStartPos = dwMemLength; + if (pifh->flags & 0x08) m_dwSongFlags |= SONG_LINEARSLIDES; if (pifh->flags & 0x10) m_dwSongFlags |= SONG_ITOLDEFFECTS; if (pifh->flags & 0x20) m_dwSongFlags |= SONG_ITCOMPATMODE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2008-02-11 22:26:13
|
Revision: 201 http://modplug.svn.sourceforge.net/modplug/?rev=201&view=rev Author: relabsoluness Date: 2008-02-11 14:26:06 -0800 (Mon, 11 Feb 2008) Log Message: ----------- . Fixed MIDI mapping not checking MIDI event, which could cause events like pitch bend to trigger some mapping item. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mpt_midi.cpp trunk/OpenMPT/soundlib/midi.h Modified: trunk/OpenMPT/mptrack/Mpt_midi.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpt_midi.cpp 2008-02-02 19:03:19 UTC (rev 200) +++ trunk/OpenMPT/mptrack/Mpt_midi.cpp 2008-02-11 22:26:06 UTC (rev 201) @@ -260,6 +260,12 @@ //---------------------------------------------------------------------------------------------------- { bool captured = false; + + if(GetFromMIDIMsg_Event(midimsg) != MIDIEVENT_CONTROLLERCHANGE) return captured; + //For now only controllers can be mapped so if event is not controller change, + //no mapping will be found and thus no search is done. + //NOTE: The event value is not checked in code below. + const BYTE controller = GetFromMIDIMsg_DataByte1(midimsg); const_iterator citer = std::lower_bound(Begin(), End(), controller); Modified: trunk/OpenMPT/soundlib/midi.h =================================================================== --- trunk/OpenMPT/soundlib/midi.h 2008-02-02 19:03:19 UTC (rev 200) +++ trunk/OpenMPT/soundlib/midi.h 2008-02-11 22:26:06 UTC (rev 201) @@ -11,10 +11,18 @@ void ApplyTransposeKeyboardSetting(CMainFrame& rMainFrm, DWORD& dwParam1); inline BYTE GetFromMIDIMsg_Channel(const DWORD MIDImsg) {return static_cast<BYTE>((MIDImsg & 0xF));} inline BYTE GetFromMIDIMsg_Event(const DWORD MIDImsg) {return static_cast<BYTE>(((MIDImsg >> 4) & 0xF));} -inline BYTE GetFromMIDIMsg_DataByte1(const DWORD MIDImsg) {return static_cast<BYTE>(((MIDImsg >> 8) & 0x7F));} -inline BYTE GetFromMIDIMsg_DataByte2(const DWORD MIDImsg) {return static_cast<BYTE>(((MIDImsg >> 16) & 0x7F));} +inline BYTE GetFromMIDIMsg_DataByte1(const DWORD MIDImsg) {return static_cast<BYTE>(((MIDImsg >> 8) & 0xFF));} +inline BYTE GetFromMIDIMsg_DataByte2(const DWORD MIDImsg) {return static_cast<BYTE>(((MIDImsg >> 16) & 0xFF));} +enum +{ + MIDIEVENT_NOTEOFF = 0x8, + MIDIEVENT_NOTEON = 0x9, + MIDIEVENT_CONTROLLERCHANGE = 0xB, + MIDIEVENT_PITCHBEND = 0xE, +}; + //========================= class CMIDIMappingDirective //========================= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2008-03-15 12:38:58
|
Revision: 204 http://modplug.svn.sourceforge.net/modplug/?rev=204&view=rev Author: relabsoluness Date: 2008-03-15 05:38:52 -0700 (Sat, 15 Mar 2008) Log Message: ----------- Bug fixing . Fix to MIDI drum export (http://lpchip.com/modplug/viewtopic.php?t=2024) . Fix to possible crash on MIDI export if exporting module with more than 64 channels. / MIDI export won't anymore export muted channels(http://lpchip.com/modplug/viewtopic.php?t=2017) . When converting MOD->S3M/IT/MPTM, finetune setting was ignored (http://lpchip.com/modplug/viewtopic.php?t=1706) . Fix to messy view in general tab on certain cases(http://lpchip.com/modplug/viewtopic.php?t=1324) . IT compatibility: Fix to not resetting envelopes on new instrument (http://lpchip.com/modplug/viewtopic.php?t=1869) . IT compatibility: Fix to bidi loop resetting (http://lpchip.com/modplug/viewtopic.php?t=788) . IT compatibility: Fix to note trigger after note cut(http://lpchip.com/modplug/viewtopic.php?t=2080) Modified Paths: -------------- trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/mod2midi.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2008-02-23 12:51:23 UTC (rev 203) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2008-03-15 12:38:52 UTC (rev 204) @@ -25,8 +25,10 @@ { CHAR s[256]; UINT b64 = 0; + + const MODTYPE oldtype = m_SndFile.GetType(); - if (nNewType == m_SndFile.GetType() && nNewType == MOD_TYPE_IT){ + if (nNewType == oldtype && nNewType == MOD_TYPE_IT){ // Even if m_nType doesn't change, we might need to change extension in itp<->it case. // This is because ITP is a HACK and doesn't genuinely change m_nType, // but uses flages instead. @@ -34,9 +36,21 @@ return TRUE; } - if(nNewType == m_SndFile.GetType()) return TRUE; + if(nNewType == oldtype) return TRUE; - if(m_SndFile.m_nType == MOD_TYPE_MPT) + const bool oldTypeIsMOD = (oldtype == MOD_TYPE_MOD), oldTypeIsXM = (oldtype == MOD_TYPE_XM), + oldTypeIsS3M = (oldtype == MOD_TYPE_S3M), oldTypeIsIT = (oldtype == MOD_TYPE_IT), + oldTypeIsMPT = (oldtype == MOD_TYPE_MPT), oldTypeIsMOD_XM = (oldTypeIsMOD || oldTypeIsXM), + oldTypeIsS3M_IT_MPT = (oldTypeIsS3M || oldTypeIsIT || oldTypeIsMPT); + + const bool newTypeIsMOD = (nNewType == MOD_TYPE_MOD), newTypeIsXM = (nNewType == MOD_TYPE_XM), + newTypeIsS3M = (nNewType == MOD_TYPE_S3M), newTypeIsIT = (nNewType == MOD_TYPE_IT), + newTypeIsMPT = (nNewType == MOD_TYPE_MPT), newTypeIsMOD_XM = (newTypeIsMOD || newTypeIsXM), + newTypeIsS3M_IT_MPT = (newTypeIsS3M || newTypeIsIT || newTypeIsMPT), + newTypeIsXM_IT_MPT = (newTypeIsXM || newTypeIsIT || newTypeIsMPT), + newTypeIsIT_MPT = (newTypeIsIT || newTypeIsMPT); + + if(oldTypeIsMPT) { if(::MessageBox(NULL, "Convertion from MPTm to any other modtype makes certain features unavailable and is not guaranteed to work properly; Do the convertion anyway?", "Notice", MB_YESNO) != IDYES) @@ -96,7 +110,7 @@ } //End if (((m_SndFile.m_nInstruments) || (b64)) && (nNewType & (MOD_TYPE_MOD|MOD_TYPE_S3M))) BeginWaitCursor(); // Adjust pattern data - if ((m_SndFile.m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) && (nNewType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) + if(oldTypeIsMOD_XM && newTypeIsS3M_IT_MPT) { for (UINT nPat=0; nPat<m_SndFile.Patterns.Size(); nPat++) if (m_SndFile.Patterns[nPat]) { @@ -152,7 +166,7 @@ } } } else - if ((m_SndFile.m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nNewType & (MOD_TYPE_MOD|MOD_TYPE_XM))) + if (oldTypeIsS3M_IT_MPT && newTypeIsMOD_XM) { for (UINT nPat=0; nPat<m_SndFile.Patterns.Size(); nPat++) if (m_SndFile.Patterns[nPat]) { @@ -224,15 +238,15 @@ } } // Convert XM to MOD - if ((m_SndFile.m_nType == MOD_TYPE_XM) && (nNewType == MOD_TYPE_MOD)) + if (oldTypeIsXM && newTypeIsMOD) { } else // Convert MOD to XM - if ((m_SndFile.m_nType == MOD_TYPE_MOD) && (nNewType == MOD_TYPE_XM)) + if (oldTypeIsMOD && newTypeIsXM) { } else - // Convert XM to S3M/IT/MPT - if ((m_SndFile.m_nType == MOD_TYPE_XM) && (nNewType != MOD_TYPE_XM)) + // Convert MOD/XM to S3M/IT/MPT + if (oldTypeIsMOD_XM && newTypeIsS3M_IT_MPT) { for (UINT i=1; i<=m_SndFile.m_nSamples; i++) { @@ -240,10 +254,10 @@ m_SndFile.Ins[i].RelativeTone = 0; m_SndFile.Ins[i].nFineTune = 0; } - if (nNewType & (MOD_TYPE_IT|MOD_TYPE_MPT)) m_SndFile.m_dwSongFlags |= SONG_ITCOMPATMODE; + if (oldTypeIsXM && newTypeIsIT_MPT) m_SndFile.m_dwSongFlags |= SONG_ITCOMPATMODE; } else // Convert S3M/IT/MPT to XM - if ((m_SndFile.m_nType != MOD_TYPE_XM) && (nNewType == MOD_TYPE_XM)) + if (oldTypeIsS3M_IT_MPT && newTypeIsXM) { for (UINT i=1; i<=m_SndFile.m_nSamples; i++) { @@ -272,25 +286,25 @@ if (bBrokenNoteMap) AddToLog("WARNING: Note Mapping will be lost when saving as XM\n"); } // Too many samples ? - if ((nNewType == MOD_TYPE_MOD) && (m_SndFile.m_nSamples > 31)) + if (newTypeIsMOD && (m_SndFile.m_nSamples > 31)) { AddToLog("WARNING: Samples above 31 will be lost when saving this file as MOD!\n"); } BEGIN_CRITICAL(); m_SndFile.ChangeModTypeTo(nNewType); - if ((!(nNewType & (MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_XM))) && (m_SndFile.m_dwSongFlags & SONG_LINEARSLIDES)) + if (!newTypeIsXM_IT_MPT && (m_SndFile.m_dwSongFlags & SONG_LINEARSLIDES)) { AddToLog("WARNING: Linear Frequency Slides not supported by the new format.\n"); m_SndFile.m_dwSongFlags &= ~SONG_LINEARSLIDES; } - if (!(nNewType & (MOD_TYPE_IT|MOD_TYPE_MPT))) m_SndFile.m_dwSongFlags &= ~(SONG_ITOLDEFFECTS|SONG_ITCOMPATMODE); - if (nNewType != MOD_TYPE_S3M) m_SndFile.m_dwSongFlags &= ~SONG_FASTVOLSLIDES; + if (!newTypeIsIT_MPT) m_SndFile.m_dwSongFlags &= ~(SONG_ITOLDEFFECTS|SONG_ITCOMPATMODE); + if (!newTypeIsS3M) m_SndFile.m_dwSongFlags &= ~SONG_FASTVOLSLIDES; END_CRITICAL(); ChangeFileExtension(nNewType); //rewbs.cutomKeys: update effect key commands CInputHandler *ih = CMainFrame::GetMainFrame()->GetInputHandler(); - if (nNewType & (MOD_TYPE_MOD|MOD_TYPE_XM)) { + if (newTypeIsMOD_XM) { ih->SetXMEffects(); } else { ih->SetITEffects(); Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2008-02-23 12:51:23 UTC (rev 203) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2008-03-15 12:38:52 UTC (rev 204) @@ -177,6 +177,7 @@ GetDeviceScrollSizes(nMapMode, sizeTotal, sizePage, sizeLine); m_rcClient.SetRect(0, 0, sizeTotal.cx, sizeTotal.cy); RecalcLayout(); + // Initializing scroll ranges for (int ichn=0; ichn<4; ichn++) { @@ -241,6 +242,7 @@ // -> CODE#0015 // -> DESC="channels management dlg" void CViewGlobals::OnDraw(CDC* pDC) +//--------------------------------- { CView::OnDraw(pDC); @@ -326,8 +328,11 @@ m_TabCtrl.InsertItem(iItem, &tci); } if (nOldSel >= (UINT)nTabCount) nOldSel = 0; + + //Changing the order of these calls seemed to fix a GUI bug (http://lpchip.com/modplug/viewtopic.php?t=1324) + m_TabCtrl.SetRedraw(TRUE); m_TabCtrl.SetCurSel(nOldSel); - m_TabCtrl.SetRedraw(TRUE); + InvalidateRect(NULL, FALSE); } nTabIndex = m_TabCtrl.GetCurSel(); @@ -1274,6 +1279,7 @@ // -> CODE#0002 // -> DESC="VST plugins presets" void CViewGlobals::OnProgramChanged() +//----------------------------------- { int cursel = m_CbnPreset.GetCurSel(); CModDoc *pModDoc = GetDocument(); @@ -1296,6 +1302,7 @@ } void CViewGlobals::OnLoadParam() +//------------------------------ { CModDoc *pModDoc = GetDocument(); CSoundFile *pSndFile = pModDoc ? pModDoc->GetSoundFile() : NULL; @@ -1321,6 +1328,7 @@ } void CViewGlobals::OnSaveParam() +//------------------------------ { CModDoc *pModDoc = GetDocument(); CSoundFile *pSndFile = pModDoc ? pModDoc->GetSoundFile() : NULL; @@ -1467,6 +1475,7 @@ // -> CODE#0028 // -> DESC="effect plugin mixing mode combo" void CViewGlobals::OnWetDryExpandChanged() +//---------------------------------------- { CModDoc *pModDoc = GetDocument(); PSNDMIXPLUGIN pPlugin; Modified: trunk/OpenMPT/mptrack/mod2midi.cpp =================================================================== --- trunk/OpenMPT/mptrack/mod2midi.cpp 2008-02-23 12:51:23 UTC (rev 203) +++ trunk/OpenMPT/mptrack/mod2midi.cpp 2008-03-15 12:38:52 UTC (rev 204) @@ -145,7 +145,7 @@ if ((penv->nMidiProgram > 20) && (penv->nMidiProgram < 120)) m_InstrMap[nIns].nProgram = penv->nMidiProgram; else - m_InstrMap[nIns].nProgram = penv->NoteMap[60] & 0x7f; + m_InstrMap[nIns].nProgram = (penv->NoteMap[60]-1) & 0x7f; } else { m_InstrMap[nIns].nProgram = penv->nMidiProgram & 0x7f; @@ -350,6 +350,10 @@ UINT nSpeed; CFile f; + const CHANNELINDEX chnCount = min(64, m_pSndFile->GetNumChannels()); + if(chnCount < m_pSndFile->GetNumChannels()) + MessageBox("Note: Only 64 channels will be exported."); + if (!f.Open(m_szFileName, CFile::modeCreate | CFile::modeWrite)) { return FALSE; @@ -366,10 +370,14 @@ mthd.id = 0x6468544d; // "MThd" mthd.len = BigEndian(sizeof(mthd)-8); mthd.wFmt = BigEndianW(1); - mthd.wTrks = BigEndianW(m_pSndFile->m_nChannels); // 1 track/channel + mthd.wTrks = chnCount; // 1 track/channel + mthd.wTrks = BigEndianW(mthd.wTrks); //Convert to big endian value. mthd.wDivision = BigEndianW(nPPQN); if (m_bRmi) f.Write(&rmid, sizeof(rmid)); f.Write(&mthd, sizeof(mthd)); + + + // Add Song Name on track 0 m_pSndFile->GetTitle(s); if (s[0]) @@ -388,7 +396,7 @@ Tracks[0].Write(m_pSndFile->m_lpszSongComments, strlen(m_pSndFile->m_lpszSongComments)); } // Add channel names - for (UINT iInit=0; iInit<m_pSndFile->m_nChannels; iInit++) + for (UINT iInit=0; iInit<chnCount; iInit++) { PDYNMIDITRACK pTrk = &Tracks[iInit]; lstrcpyn(s, m_pSndFile->ChnSettings[iInit].szName, MAX_CHANNELNAME); @@ -422,10 +430,13 @@ nRow = 0; continue; } - for (UINT nChn=0; nChn<m_pSndFile->m_nChannels; nChn++) + for (UINT nChn=0; nChn<chnCount; nChn++) { + //Skip muted channels. + if(m_pSndFile->ChnSettings[nChn].dwFlags & CHN_MUTE) continue; + PDYNMIDITRACK pTrk = &Tracks[nChn]; - MODCOMMAND *m = m_pSndFile->Patterns[nPat] + nRow*m_pSndFile->m_nChannels + nChn; + MODCOMMAND *m = m_pSndFile->Patterns[nPat].GetpModCommand(nRow, nChn); UINT delta_time = nClock - pTrk->nLastEventClock; UINT len = 0; @@ -523,7 +534,7 @@ } } // Write midi tracks - for (UINT iTrk=0; iTrk<m_pSndFile->m_nChannels; iTrk++) + for (UINT iTrk=0; iTrk<chnCount; iTrk++) { tmp[0] = 0x00; tmp[1] = 0xff; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2008-02-23 12:51:23 UTC (rev 203) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2008-03-15 12:38:52 UTC (rev 204) @@ -413,6 +413,8 @@ MODINSTRUMENT *psmp = &Ins[instr]; UINT note = pChn->nNewNote; + if(note == 0 && TypeIsIT_MPT() && GetModFlag(MSF_IT_COMPATIBLE_PLAY)) return; + if ((penv) && (note) && (note <= 128)) { if (penv->NoteMap[note-1] >= 0xFE) return; @@ -426,7 +428,8 @@ } const bool bNewTuning = (m_nType == MOD_TYPE_MPT && penv && penv->pTuning); - //Playback behavior change for MPT: Don't change sample if it is in the same instrument as previous sample. + //Playback behavior change for MPT: With portamento don't change sample if it is in + //the same instrument as previous sample. if(bPorta && bNewTuning && penv == pChn->pHeader) return; @@ -436,14 +439,17 @@ { bInstrumentChanged = TRUE; pChn->pHeader = penv; - } else - // Special XM hack - if ((bPorta) && (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) && (penv) - && (pChn->pInstrument) && (psmp != pChn->pInstrument)) - { - // FT2 doesn't change the sample in this case, - // but still uses the sample info from the old one (bug?) - returnAfterVolumeAdjust = true; + } + else + { + // Special XM hack + if ((bPorta) && (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) && (penv) + && (pChn->pInstrument) && (psmp != pChn->pInstrument)) + { + // FT2 doesn't change the sample in this case, + // but still uses the sample info from the old one (bug?) + returnAfterVolumeAdjust = true; + } } // Update Volume @@ -486,7 +492,9 @@ if (bResetEnv) { if ((!bPorta) || (!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) || (m_dwSongFlags & SONG_ITCOMPATMODE) - || (!pChn->nLength) || ((pChn->dwFlags & CHN_NOTEFADE) && (!pChn->nFadeOutVol))) + || (!pChn->nLength) || ((pChn->dwFlags & CHN_NOTEFADE) && (!pChn->nFadeOutVol)) + //IT compatibility tentative fix: Reset envelopes when instrument changes. + || (TypeIsIT_MPT() && GetModFlag(MSF_IT_COMPATIBLE_PLAY) && bInstrumentChanged)) { pChn->dwFlags |= CHN_FASTVOLRAMP; if ((m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!bInstrumentChanged) && (penv) && (!(pChn->dwFlags & (CHN_KEYOFF|CHN_NOTEFADE)))) @@ -520,7 +528,15 @@ } else { pChn->dwFlags &= ~(CHN_KEYOFF|CHN_NOTEFADE|CHN_VOLENV|CHN_PANENV|CHN_PITCHENV); - pChn->dwFlags = (pChn->dwFlags & 0xFFFFFF00) | (psmp->uFlags & 0xFF); + + //IT compatibility tentative fix: Don't anymore change bidi loop direction when + //no sample nor instrument is changed. + if(TypeIsIT_MPT() && GetModFlag(MSF_IT_COMPATIBLE_PLAY) && psmp == pChn->pInstrument && !bInstrumentChanged) + pChn->dwFlags = (pChn->dwFlags & (0xFFFFFF00 | CHN_PINGPONGFLAG)) | (psmp->uFlags & 0xFF); + else + pChn->dwFlags = (pChn->dwFlags & 0xFFFFFF00) | (psmp->uFlags & 0xFF); + + if (penv) { if (penv->dwFlags & ENV_VOLUME) pChn->dwFlags |= CHN_VOLENV; @@ -594,11 +610,17 @@ // Key Off KeyOff(nChn); // Note Cut - if (note == 0xFE) + if (note == NOTE_NOTECUT) { pChn->dwFlags |= (CHN_NOTEFADE|CHN_FASTVOLRAMP); if ((!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) || (m_nInstruments)) pChn->nVolume = 0; pChn->nFadeOutVol = 0; + + //IT compatibility tentative fix: Clear channel note memory on note cut. + if(TypeIsIT_MPT() && GetModFlag(MSF_IT_COMPATIBLE_PLAY)) + { + pChn->nNote = pChn->nNewNote = 0; + } } return; } @@ -667,7 +689,10 @@ if (pChn->nTremoloType < 4) pChn->nTremoloPos = 0; } if (pChn->nPos >= pChn->nLength) pChn->nPos = pChn->nLoopStart; - } else bPorta = FALSE; + } + else + bPorta = FALSE; + if ((!bPorta) || (!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) || ((pChn->dwFlags & CHN_NOTEFADE) && (!pChn->nFadeOutVol)) || ((m_dwSongFlags & SONG_ITCOMPATMODE) && (pChn->nRowInstr))) @@ -1113,13 +1138,11 @@ { if(instr < MAX_INSTRUMENTS && pChn->pHeader != Headers[instr]) note = pChn->nNote; - } else //Case: Only samples used { if(instr < MAX_SAMPLES && pChn->pSample != Ins[instr].pSample) note = pChn->nNote; - } } @@ -1188,7 +1211,7 @@ InstrumentChange(pChn, instr, bPorta, TRUE); pChn->nNewIns = 0; // Special IT case: portamento+note causes sample change -> ignore portamento - if ((m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT)) + if ((m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) && (psmp != pChn->pInstrument) && (note) && (note < 0x80)) { bPorta = FALSE; @@ -1406,34 +1429,6 @@ if (m_nTickCount) break; //rewbs.volOffset: moved sample offset code to own method SampleOffset(nChn, param, bPorta); - - -/* if (param) pChn->nOldOffset = param; else param = pChn->nOldOffset; - param <<= 8; - param |= (UINT)(pChn->nOldHiOffset) << 16; - if ((pChn->nRowNote) && (pChn->nRowNote < 0x80)) - { - if (bPorta) - pChn->nPos = param; - else - pChn->nPos += param; - if (pChn->nPos >= pChn->nLength) - { - if (!(m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2))) - { - pChn->nPos = pChn->nLoopStart; - if ((m_dwSongFlags & SONG_ITOLDEFFECTS) && (pChn->nLength > 4)) - { - pChn->nPos = pChn->nLength - 2; - } - } - } - } else - if ((param < pChn->nLength) && (m_nType & (MOD_TYPE_MTM|MOD_TYPE_DMF))) - { - pChn->nPos = param; - } -*/ break; // Arpeggio Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2008-02-23 12:51:23 UTC (rev 203) +++ trunk/OpenMPT/soundlib/Sndfile.h 2008-03-15 12:38:52 UTC (rev 204) @@ -110,7 +110,7 @@ #define CHN_PINGPONGSUSTAIN 0x10 #define CHN_PANNING 0x20 #define CHN_STEREO 0x40 -#define CHN_PINGPONGFLAG 0x80 +#define CHN_PINGPONGFLAG 0x80 //When flag is on, bidiloop is processed backwards? // Bits 8-31: Channel Flags #define CHN_MUTE 0x100 #define CHN_KEYOFF 0x200 @@ -959,6 +959,7 @@ BOOL Create(LPCBYTE lpStream, CModDoc *pModDoc, DWORD dwMemLength=0); BOOL Destroy(); MODTYPE GetType() const { return m_nType; } + inline bool TypeIsIT_MPT() const {return (m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) != 0;} CModDoc* GetpModDoc() {return m_pModDoc;} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2008-03-17 18:11:52
|
Revision: 205 http://modplug.svn.sourceforge.net/modplug/?rev=205&view=rev Author: relabsoluness Date: 2008-03-17 11:11:44 -0700 (Mon, 17 Mar 2008) Log Message: ----------- . Internal: fixes to make things work on newer VC compilers. Modified Paths: -------------- trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/mptrack/tuningRatioMapWnd.h trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/midi.h trunk/OpenMPT/soundlib/tuning.cpp Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.cpp 2008-03-15 12:38:52 UTC (rev 204) +++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2008-03-17 18:11:44 UTC (rev 205) @@ -8,8 +8,8 @@ const CTuningDialog::TUNINGTREEITEM CTuningDialog::s_notFoundItemTuning = TUNINGTREEITEM(); const HTREEITEM CTuningDialog::s_notFoundItemTree = NULL; -using CTuning::UNOTEINDEXTYPE; -using CTuning::RATIOTYPE; +typedef CTuning::UNOTEINDEXTYPE UNOTEINDEXTYPE; +typedef CTuning::RATIOTYPE RATIOTYPE; #define TT_GENERAL CTuning::TT_GENERAL #define TT_GROUPGEOMETRIC CTuning::TT_GROUPGEOMETRIC #define TT_GEOMETRIC CTuning::TT_GEOMETRIC Modified: trunk/OpenMPT/mptrack/tuningRatioMapWnd.h =================================================================== --- trunk/OpenMPT/mptrack/tuningRatioMapWnd.h 2008-03-15 12:38:52 UTC (rev 204) +++ trunk/OpenMPT/mptrack/tuningRatioMapWnd.h 2008-03-17 18:11:44 UTC (rev 205) @@ -5,7 +5,7 @@ class CTuningDialog; -using CTuning::NOTEINDEXTYPE; +typedef CTuning::NOTEINDEXTYPE NOTEINDEXTYPE; //Copied from CNoteMapWnd. //=============================== Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2008-03-15 12:38:52 UTC (rev 204) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2008-03-17 18:11:44 UTC (rev 205) @@ -2948,7 +2948,7 @@ const CModSpecifications& CSoundFile::GetModSpecifications(const MODTYPE type) //---------------------------------------------------------------------------- { - CModSpecifications* p = 0; + const CModSpecifications* p = 0; SetModSpecsPointer(p, type); return *p; } Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2008-03-15 12:38:52 UTC (rev 204) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2008-03-17 18:11:44 UTC (rev 205) @@ -99,7 +99,7 @@ 0x92, 0x94, 0x96, 0x98, }; -using CTuning::RATIOTYPE; +typedef CTuning::RATIOTYPE RATIOTYPE; static const RATIOTYPE TwoToPowerXOver12Table[16] = { Modified: trunk/OpenMPT/soundlib/midi.h =================================================================== --- trunk/OpenMPT/soundlib/midi.h 2008-03-15 12:38:52 UTC (rev 204) +++ trunk/OpenMPT/soundlib/midi.h 2008-03-17 18:11:44 UTC (rev 205) @@ -92,6 +92,7 @@ class CSoundFile; inline bool operator<(const CMIDIMappingDirective& a, const CMIDIMappingDirective& b) {return a.GetController() < b.GetController();} inline bool operator<(const CMIDIMappingDirective& d, const BYTE& ctrlVal) {return d.GetController() < ctrlVal;} +inline bool operator<(const BYTE& ctrlVal, const CMIDIMappingDirective& d) {return ctrlVal < d.GetController();} //=============== class CMIDIMapper Modified: trunk/OpenMPT/soundlib/tuning.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuning.cpp 2008-03-15 12:38:52 UTC (rev 204) +++ trunk/OpenMPT/soundlib/tuning.cpp 2008-03-17 18:11:44 UTC (rev 205) @@ -4,11 +4,11 @@ #include "../mptrack/serialization_utils.h" #include <string> -using CTuningRTI::RATIOTYPE; -using CTuningRTI::NOTEINDEXTYPE; -using CTuningRTI::UNOTEINDEXTYPE; -using CTuningRTI::STEPINDEXTYPE; -using CTuningRTI::USTEPINDEXTYPE; +typedef CTuningRTI::RATIOTYPE RATIOTYPE; +typedef CTuningRTI::NOTEINDEXTYPE NOTEINDEXTYPE; +typedef CTuningRTI::UNOTEINDEXTYPE UNOTEINDEXTYPE; +typedef CTuningRTI::STEPINDEXTYPE STEPINDEXTYPE; +typedef CTuningRTI::USTEPINDEXTYPE USTEPINDEXTYPE; const NOTEINDEXTYPE CTuningRTI::s_StepMinDefault(-64); const UNOTEINDEXTYPE CTuningRTI::s_RatioTableSizeDefault(128); @@ -77,7 +77,7 @@ BelowRatios = AboveRatios = DefaultBARFUNC; m_RatioTable.resize(vr.second-vr.first+1); - std::copy(v.begin(), v.end(), m_RatioTable.begin() + ratiostartpos - vr.first); + std::copy(v.begin(), v.end(), m_RatioTable.begin() + (ratiostartpos - vr.first)); for(NOTEINDEXTYPE i = ratiostartpos-1; i>=m_StepMin && ratiostartpos > NOTEINDEXTYPE_MIN; i--) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2008-03-19 20:38:20
|
Revision: 206 http://modplug.svn.sourceforge.net/modplug/?rev=206&view=rev Author: relabsoluness Date: 2008-03-19 13:38:12 -0700 (Wed, 19 Mar 2008) Log Message: ----------- Bug fixing. . Fix to possible crash when browsing modules in treeview(http://lpchip.com/modplug/viewtopic.php?t=2222). . Fix to severe memory leak in the same section as above. . Fix to mptm not showing in tree view file browser. ? Some internal modifications Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_ins.h trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_smp.h trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/Vstplug.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2008-03-19 20:38:12 UTC (rev 206) @@ -450,7 +450,7 @@ GetPrivateProfileLong("AutoSave", "Enabled", true, iniFile)?m_pAutoSaver->Enable():m_pAutoSaver->Disable(); m_pAutoSaver->SetSaveInterval(GetPrivateProfileLong("AutoSave", "IntervalMinutes", 10, iniFile)); m_pAutoSaver->SetHistoryDepth(GetPrivateProfileLong("AutoSave", "BackupHistory", 3, iniFile)); - m_pAutoSaver->SetUseOriginalPath(GetPrivateProfileLong("AutoSave", "UseOriginalPath", true, iniFile)); + m_pAutoSaver->SetUseOriginalPath(GetPrivateProfileLong("AutoSave", "UseOriginalPath", true, iniFile) != 0); m_pAutoSaver->SetPath(GetPrivateProfileCString("AutoSave", "Path", "", iniFile)); m_pAutoSaver->SetFilenameTemplate(GetPrivateProfileCString("AutoSave", "FileNameTemplate", "", iniFile)); } @@ -961,7 +961,7 @@ { CHAR valueBuffer[INIBUFFERSIZE]; wsprintf(valueBuffer, "%li", value); - return WritePrivateProfileString(section, key, valueBuffer, iniFile); + return (WritePrivateProfileString(section, key, valueBuffer, iniFile) != 0); } @@ -981,7 +981,7 @@ { CHAR valueBuffer[INIBUFFERSIZE]; wsprintf(valueBuffer, "%lu", value); - return WritePrivateProfileString(section, key, valueBuffer, iniFile); + return (WritePrivateProfileString(section, key, valueBuffer, iniFile) != 0); } DWORD CMainFrame::GetPrivateProfileDWord(const CString section, const CString key, const DWORD defaultValue, const CString iniFile) @@ -996,7 +996,7 @@ bool CMainFrame::WritePrivateProfileCString(const CString section, const CString key, const CString value, const CString iniFile) { - return WritePrivateProfileString(section, key, value, iniFile); + return (WritePrivateProfileString(section, key, value, iniFile) != 0); } CString CMainFrame::GetPrivateProfileCString(const CString section, const CString key, const CString defaultValue, const CString iniFile) Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2008-03-19 20:38:12 UTC (rev 206) @@ -922,7 +922,7 @@ } -#if _MSC_VER >= 1400 +#if _MFC_VER > 0x0710 LRESULT CModTreeBar::OnNcHitTest(CPoint point) #else UINT CModTreeBar::OnNcHitTest(CPoint point) Modified: trunk/OpenMPT/mptrack/Mainbar.h =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.h 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/mptrack/Mainbar.h 2008-03-19 20:38:12 UTC (rev 206) @@ -116,7 +116,7 @@ protected: //{{AFX_MSG(CModTreeBar) afx_msg void OnNcPaint(); -#if _MSC_VER >= 1400 +#if _MFC_VER > 0x0710 afx_msg LRESULT OnNcHitTest(CPoint point); #else afx_msg UINT OnNcHitTest(CPoint point); Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2008-03-19 20:38:12 UTC (rev 206) @@ -1700,7 +1700,7 @@ } -#if _MSC_VER >= 1400 +#if _MFC_VER > 0x0710 LRESULT CViewInstrument::OnNcHitTest(CPoint point) #else UINT CViewInstrument::OnNcHitTest(CPoint point) Modified: trunk/OpenMPT/mptrack/View_ins.h =================================================================== --- trunk/OpenMPT/mptrack/View_ins.h 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/mptrack/View_ins.h 2008-03-19 20:38:12 UTC (rev 206) @@ -98,7 +98,7 @@ afx_msg BOOL OnEraseBkgnd(CDC *) { return TRUE; } afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp); -#if _MSC_VER >= 1400 +#if _MFC_VER > 0x0710 afx_msg LRESULT OnNcHitTest(CPoint point); #else afx_msg UINT OnNcHitTest(CPoint point); Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2008-03-19 20:38:12 UTC (rev 206) @@ -1408,7 +1408,7 @@ } -#if _MSC_VER >= 1400 +#if _MFC_VER > 0x0710 LRESULT CViewSample::OnNcHitTest(CPoint point) #else UINT CViewSample::OnNcHitTest(CPoint point) Modified: trunk/OpenMPT/mptrack/View_smp.h =================================================================== --- trunk/OpenMPT/mptrack/View_smp.h 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/mptrack/View_smp.h 2008-03-19 20:38:12 UTC (rev 206) @@ -59,7 +59,7 @@ afx_msg BOOL OnEraseBkgnd(CDC *) { return TRUE; } afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp); -#if _MSC_VER >= 1400 +#if _MFC_VER > 0x0710 afx_msg LRESULT OnNcHitTest(CPoint point); #else afx_msg UINT OnNcHitTest(CPoint point); Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2008-03-19 20:38:12 UTC (rev 206) @@ -247,7 +247,9 @@ LPBYTE lpStream = f.Lock(); if (lpStream) { - m_SongFile.Create(lpStream, CMainFrame::GetMainFrame()->GetActiveDoc(), dwLen); + //m_SongFile.Create(lpStream, CMainFrame::GetMainFrame()->GetActiveDoc(), dwLen); + m_SongFile.Destroy(); + m_SongFile.Create(lpStream, NULL, dwLen); f.Unlock(); } } @@ -1530,6 +1532,7 @@ || (!lstrcmpi(s, ".s3m")) || (!lstrcmpi(s, ".xm")) || (!lstrcmpi(s, ".it")) + || (!lstrcmpi(s, ".mptm")) // -> CODE#0023 // -> DESC="IT project files (.itp)" // || (!lstrcmpi(s, ".itp")) ericus 03/03/2005 : temporarily deactivated 03/03/2005 Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2008-03-19 20:38:12 UTC (rev 206) @@ -39,13 +39,13 @@ } -BOOL CVstPluginManager::CreateMixPluginProc(PSNDMIXPLUGIN pMixPlugin, CModDoc *pModDoc) +BOOL CVstPluginManager::CreateMixPluginProc(PSNDMIXPLUGIN pMixPlugin, CSoundFile* pSndFile) //------------------------------------------------------------------------------------- { CVstPluginManager *that = theApp.GetPluginManager(); if (that) { - return that->CreateMixPlugin(pMixPlugin, pModDoc); + return that->CreateMixPlugin(pMixPlugin, pSndFile); } return FALSE; } @@ -408,7 +408,7 @@ } -BOOL CVstPluginManager::CreateMixPlugin(PSNDMIXPLUGIN pMixPlugin, CModDoc *pModDoc) +BOOL CVstPluginManager::CreateMixPlugin(PSNDMIXPLUGIN pMixPlugin, CSoundFile* pSndFile) //--------------------------------------------------------------------------------- { UINT nMatch=0; @@ -462,7 +462,7 @@ CVstPlugin *pVstPlug = new CVstPlugin(NULL, pFound, pMixPlugin, pEffect); if (pVstPlug) { - pVstPlug->Initialize(pModDoc); + pVstPlug->Initialize(pSndFile); bOk = TRUE; } END_CRITICAL(); @@ -547,7 +547,7 @@ } } CVstPlugin *pVstPlug = new CVstPlugin(hLibrary, pFound, pMixPlugin, pEffect); - if (pVstPlug) pVstPlug->Initialize(pModDoc); + if (pVstPlug) pVstPlug->Initialize(pSndFile); } } else { @@ -1145,7 +1145,7 @@ // Now, create the new plugin if (pManager) { - pManager->CreateMixPlugin(m_pPlugin, m_pModDoc); + pManager->CreateMixPlugin(m_pPlugin, (m_pModDoc) ? m_pModDoc->GetSoundFile() : 0); if (m_pPlugin->pMixPlugin) { CHAR s[128]; @@ -1518,7 +1518,7 @@ } -void CVstPlugin::Initialize(CModDoc *pModDoc) +void CVstPlugin::Initialize(CSoundFile* pSndFile) //------------------------------------------- { if (!m_pEvList) @@ -1541,8 +1541,8 @@ //Assuming 32bit address space... m_pEffect->resvd1=(long)this; //rewbs.plugDocAware - m_pModDoc = pModDoc; - m_pSndFile = pModDoc->GetSoundFile(); + m_pSndFile = pSndFile; + m_pModDoc = pSndFile->GetpModDoc(); m_nSlot = FindSlot(); //end rewbs.plugDocAware @@ -2079,7 +2079,7 @@ float gain = 0.1f * (float)( m_pMixStruct ? (m_pMixStruct->Info.dwInputRouting>>16) & 0xff : 10 ); if(gain < 0.1f) gain = 1.0f; - if (m_bIsInstrument) { + if (m_bIsInstrument && m_pSndFile) { gain /= m_pSndFile->m_pConfig->getVSTiAttenuation(); gain *= (m_pSndFile->m_nVSTiVolume / m_pSndFile->m_pConfig->getNormalVSTiVol()); } @@ -2543,7 +2543,7 @@ nParam=127; } - if(m_pSndFile->GetModFlag(MSF_MIDICC_BUGEMULATION)) + if(m_pSndFile && m_pSndFile->GetModFlag(MSF_MIDICC_BUGEMULATION)) MidiSend(nController<<16 | nParam<<8 | 0xB0|nMidiCh); else MidiSend(nParam<<16 | nController<<8 | 0xB0|nMidiCh); @@ -2710,13 +2710,15 @@ } bool CVstPlugin::isPlaying(UINT note, UINT midiChn, UINT trackerChn) +//------------------------------------------------------------------ { note--; PVSTINSTCH pMidiCh = &m_MidiCh[(midiChn-1) & 0x0f]; - return pMidiCh->uNoteOnMap[note][trackerChn]; + return (pMidiCh->uNoteOnMap[note][trackerChn] != 0); } bool CVstPlugin::MoveNote(UINT note, UINT midiChn, UINT sourceTrackerChn, UINT destTrackerChn) +//--------------------------------------------------------------------------------------------- { note--; PVSTINSTCH pMidiCh = &m_MidiCh[(midiChn-1) & 0x0f]; @@ -2820,7 +2822,7 @@ && (m_pEffect->uniqueID != 'Sytr')) //special case: imageline sytrus pretends to support chunks but gives us garbage. { PVOID p = NULL; - LONG nByteSize; + LONG nByteSize = 0; // Try to get whole bank if (m_pEffect->uniqueID != 1984054788) { //special case: VB ffx4 pretends to get a valid bank but gives us garbage. @@ -2839,7 +2841,7 @@ m_pMixStruct->nPluginDataSize = nByteSize+4; } else { - if (m_pMixStruct->pPluginData) delete[] m_pMixStruct->pPluginData; + delete[] m_pMixStruct->pPluginData; m_pMixStruct->nPluginDataSize = 0; m_pMixStruct->pPluginData = new char[nByteSize+4]; if (m_pMixStruct->pPluginData) @@ -3001,11 +3003,13 @@ //rewbs.defaultPlugGui CAbstractVstEditor* CVstPlugin::GetEditor() +//----------------------------------------- { return m_pEditor; } bool CVstPlugin::Bypass(bool bypass) +//----------------------------------- { if (bypass) { m_pMixStruct->Info.dwInputRouting |= MIXPLUG_INPUTF_BYPASS; @@ -3020,13 +3024,15 @@ return bypass; } bool CVstPlugin::Bypass() +//----------------------- { return Bypass(!IsBypassed()); } bool CVstPlugin::IsBypassed() +//--------------------------- { - return m_pMixStruct->Info.dwInputRouting & MIXPLUG_INPUTF_BYPASS; + return ((m_pMixStruct->Info.dwInputRouting & MIXPLUG_INPUTF_BYPASS) != 0); } //end rewbs.defaultPlugGui @@ -3035,6 +3041,7 @@ //rewbs.VSTcompliance BOOL CVstPlugin::GetSpeakerArrangement() +//-------------------------------------- { VstSpeakerArrangement **pSA = NULL; Dispatch(effGetSpeakerArrangement, 0,0,pSA,0); @@ -3044,7 +3051,9 @@ return true; } -void CVstPlugin::NotifySongPlaying(bool playing) { +void CVstPlugin::NotifySongPlaying(bool playing) +//---------------------------------------------- +{ m_bSongPlaying=playing; } @@ -3095,10 +3104,11 @@ bool CVstPlugin::KeysRequired() //----------------------------- { - return (CVstPlugin::Dispatch(effKeysRequired, 0, 0, NULL, 0)); + return (CVstPlugin::Dispatch(effKeysRequired, 0, 0, NULL, 0) != 0); } void CVstPlugin::GetOutputPlugList(CArray<CVstPlugin*,CVstPlugin*> &list) +//----------------------------------------------------------------------- { // At the moment we know there will only be 1 output. // Returning NULL ptr means plugin outputs directly to master. @@ -3107,7 +3117,7 @@ CVstPlugin *pOutputPlug = NULL; if (m_pMixStruct->Info.dwOutputRouting & 0x80) { UINT nOutput = m_pMixStruct->Info.dwOutputRouting & 0x7f; - if ((nOutput > m_nSlot) && (nOutput < MAX_MIXPLUGINS)) { + if (m_pSndFile && (nOutput > m_nSlot) && (nOutput < MAX_MIXPLUGINS)) { pOutputPlug = (CVstPlugin*) m_pSndFile->m_MixPlugins[nOutput].pMixPlugin; } } @@ -3117,7 +3127,10 @@ } void CVstPlugin::GetInputPlugList(CArray<CVstPlugin*,CVstPlugin*> &list) +//---------------------------------------------------------------------- { + if(m_pSndFile == 0) return; + CArray<CVstPlugin*, CVstPlugin*> candidatePlugOutputs; CVstPlugin* pCandidatePlug = NULL; list.RemoveAll(); @@ -3139,16 +3152,15 @@ return; } -void CVstPlugin::GetInputInstrumentList(CArray<UINT,UINT> &list) +void CVstPlugin::GetInputInstrumentList(CArray<UINT,UINT> &list) +//-------------------------------------------------------------- { list.RemoveAll(); + if(m_pSndFile == 0) return; - CModDoc* pModDoc = GetModDoc(); - CSoundFile* pSndFile = pModDoc->GetSoundFile(); - UINT nThisMixPlug = m_nSlot+1; //m_nSlot is position in mixplug array. for (int nIns=0; nIns<MAX_INSTRUMENTS; nIns++) { - if (pSndFile->Headers[nIns] && (pSndFile->Headers[nIns]->nMixPlug==nThisMixPlug)) { + if (m_pSndFile->Headers[nIns] && (m_pSndFile->Headers[nIns]->nMixPlug==nThisMixPlug)) { list.Add(nIns); } } @@ -3157,16 +3169,16 @@ } -void CVstPlugin::GetInputChannelList(CArray<UINT,UINT> &list) +void CVstPlugin::GetInputChannelList(CArray<UINT,UINT> &list) +//------------------------------------------------------------ { + if(m_pSndFile == 0) return; list.RemoveAll(); - CModDoc* pModDoc = GetModDoc(); - CSoundFile* pSndFile = pModDoc->GetSoundFile(); - UINT nThisMixPlug = m_nSlot+1; //m_nSlot is position in mixplug array. - for (int nChn=0; nChn<pSndFile->m_nChannels; nChn++) { - if (pSndFile->ChnSettings[nChn].nMixPlugin==nThisMixPlug) { + const CHANNELINDEX chnCount = m_pSndFile->GetNumChannels(); + for (CHANNELINDEX nChn=0; nChn<chnCount; nChn++) { + if (m_pSndFile->ChnSettings[nChn].nMixPlugin==nThisMixPlug) { list.Add(nChn); } } Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/mptrack/Vstplug.h 2008-03-19 20:38:12 UTC (rev 206) @@ -93,7 +93,7 @@ public: CVstPlugin(HINSTANCE hLibrary, PVSTPLUGINLIB pFactory, PSNDMIXPLUGIN pMixPlugin, AEffect *pEffect); virtual ~CVstPlugin(); - void Initialize(CModDoc* pModDoc); + void Initialize(CSoundFile* pSndFile); public: PVSTPLUGINLIB GetPluginFactory() const { return m_pFactory; } @@ -208,7 +208,7 @@ BOOL IsValidPlugin(const VSTPLUGINLIB *pLib); PVSTPLUGINLIB AddPlugin(LPCSTR pszDllPath, BOOL bCache=TRUE, const bool checkFileExistence = false, CString* const errStr = 0); BOOL RemovePlugin(PVSTPLUGINLIB); - BOOL CreateMixPlugin(PSNDMIXPLUGIN, CModDoc*); + BOOL CreateMixPlugin(PSNDMIXPLUGIN, CSoundFile*); VOID OnIdle(); static void ReportPlugException(LPCSTR format,...); @@ -218,7 +218,7 @@ protected: long VstCallback(AEffect *effect, long opcode, long index, long value, void *ptr, float opt); static long VSTCALLBACK MasterCallBack(AEffect *effect, long opcode, long index, long value, void *ptr, float opt); - static BOOL __cdecl CreateMixPluginProc(PSNDMIXPLUGIN, CModDoc*); + static BOOL __cdecl CreateMixPluginProc(PSNDMIXPLUGIN, CSoundFile*); VstTimeInfo timeInfo; //rewbs.VSTcompliance }; Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2008-03-19 20:38:12 UTC (rev 206) @@ -172,8 +172,9 @@ notFoundTunings.push_back(str); string erm = string("Tuning ") + str + string(" used by the module was not found."); MessageBox(0, erm.c_str(), 0, MB_ICONINFORMATION); - csf.m_pModDoc->SetModified(); //The tuning is changed so - //the modified flag is set. + if(csf.GetpModDoc()) //The tuning is changed so the modified flag is set. + csf.GetpModDoc()->SetModified(); + } csf.Headers[i]->pTuning = csf.Headers[i]->s_DefaultTuning; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2008-03-19 20:38:12 UTC (rev 206) @@ -3427,8 +3427,10 @@ // Channel mutes for (UINT chan=0; chan<m_nChannels; chan++) { - if (m_bChannelMuteTogglePending[chan]) { - m_pModDoc->MuteChannel(chan, !m_pModDoc->IsChannelMuted(chan)); + if (m_bChannelMuteTogglePending[chan]) + { + if(m_pModDoc) + m_pModDoc->MuteChannel(chan, !m_pModDoc->IsChannelMuted(chan)); m_bChannelMuteTogglePending[chan]=false; } } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2008-03-19 20:38:12 UTC (rev 206) @@ -687,15 +687,15 @@ } if ((m_nRestartPos >= Order.size()) || (Order[m_nRestartPos] >= Patterns.Size())) m_nRestartPos = 0; - // Load plugins - if (gpMixPluginCreateProc) + // Load plugins only when m_pModDoc != 0. (can be == 0 for example when examining module samples in treeview. + if (gpMixPluginCreateProc && GetpModDoc()) { for (UINT iPlug=0; iPlug<MAX_MIXPLUGINS; iPlug++) { if ((m_MixPlugins[iPlug].Info.dwPluginId1) || (m_MixPlugins[iPlug].Info.dwPluginId2)) { - gpMixPluginCreateProc(&m_MixPlugins[iPlug], pModDoc); + gpMixPluginCreateProc(&m_MixPlugins[iPlug], this); if (m_MixPlugins[iPlug].pMixPlugin) { m_MixPlugins[iPlug].pMixPlugin->RestoreAllParameters(m_MixPlugins[iPlug].defaultProgram); //rewbs.plugDefaultProgram: added param @@ -728,16 +728,13 @@ Patterns[i] = NULL; } m_nPatternNames = 0; - if (m_lpszPatternNames) - { - delete[] m_lpszPatternNames; - m_lpszPatternNames = NULL; - } - if (m_lpszSongComments) - { - delete[] m_lpszSongComments; - m_lpszSongComments = NULL; - } + + delete[] m_lpszPatternNames; + m_lpszPatternNames = NULL; + + delete[] m_lpszSongComments; + m_lpszSongComments = NULL; + for (i=1; i<MAX_SAMPLES; i++) { MODINSTRUMENT *pins = &Ins[i]; @@ -749,11 +746,8 @@ } for (i=0; i<MAX_INSTRUMENTS; i++) { - if (Headers[i]) - { - delete Headers[i]; - Headers[i] = NULL; - } + delete Headers[i]; + Headers[i] = NULL; } for (i=0; i<MAX_MIXPLUGINS; i++) { @@ -1365,8 +1359,11 @@ ResetChannelState(nch, CHNRESET_TOTAL); - m_pModDoc->Record1Channel(nch,FALSE); - m_pModDoc->Record2Channel(nch,FALSE); + if(m_pModDoc) + { + m_pModDoc->Record1Channel(nch,FALSE); + m_pModDoc->Record2Channel(nch,FALSE); + } m_bChannelMuteTogglePending[nch] = false; return false; @@ -1498,11 +1495,13 @@ { settings[i] = ChnSettings[i]; chns[i] = Chn[i]; - recordStates[i] = m_pModDoc->IsChannelRecord(i); + if(m_pModDoc) + recordStates[i] = m_pModDoc->IsChannelRecord(i); chnMutePendings[i] = m_bChannelMuteTogglePending[i]; } - m_pModDoc->ReinitRecordState(); + if(m_pModDoc) + m_pModDoc->ReinitRecordState(); for (UINT i=0; i<nRemainingChannels; i++) { @@ -1510,8 +1509,11 @@ { ChnSettings[i] = settings[newOrder[i]]; Chn[i] = chns[newOrder[i]]; - if(recordStates[newOrder[i]] == 1) m_pModDoc->Record1Channel(i,TRUE); - if(recordStates[newOrder[i]] == 2) m_pModDoc->Record2Channel(i,TRUE); + if(m_pModDoc) + { + if(recordStates[newOrder[i]] == 1) m_pModDoc->Record1Channel(i,TRUE); + if(recordStates[newOrder[i]] == 2) m_pModDoc->Record2Channel(i,TRUE); + } m_bChannelMuteTogglePending[i] = chnMutePendings[newOrder[i]]; } else Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2008-03-17 18:11:44 UTC (rev 205) +++ trunk/OpenMPT/soundlib/Sndfile.h 2008-03-19 20:38:12 UTC (rev 206) @@ -45,7 +45,7 @@ //#else // -> CODE#0006 // -> DESC="misc quantity changes" -#define MAX_CHANNELS 256 //200 +#define MAX_CHANNELS 256 //200 //Note: MAX_BASECHANNELS defines max pattern channels // -! BEHAVIOUR_CHANGE#0006 //#endif // -> CODE#0006 @@ -53,7 +53,7 @@ //#ifdef FASTSOUNDLIB //#define MAX_BASECHANNELS 64 //#else -#define MAX_BASECHANNELS 127 +#define MAX_BASECHANNELS 127 //Max pattern channels. //#endif // -! BEHAVIOUR_CHANGE#0006 #define MAX_ENVPOINTS 32 @@ -731,7 +731,7 @@ //class CSoundFile; class CModDoc; -typedef BOOL (__cdecl *PMIXPLUGINCREATEPROC)(PSNDMIXPLUGIN, CModDoc*); +typedef BOOL (__cdecl *PMIXPLUGINCREATEPROC)(PSNDMIXPLUGIN, CSoundFile*); struct SNDMIXSONGEQ { @@ -939,7 +939,7 @@ SNDMIXPLUGIN m_MixPlugins[MAX_MIXPLUGINS]; // Mix plugins SNDMIXSONGEQ m_SongEQ; // Default song EQ preset CHAR CompressionTable[16]; - bool m_bChannelMuteTogglePending[MAX_CHANNELS]; + bool m_bChannelMuteTogglePending[MAX_BASECHANNELS]; CSoundFilePlayConfig* m_pConfig; DWORD m_dwCreatedWithVersion; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2008-03-25 20:15:44
|
Revision: 207 http://modplug.svn.sourceforge.net/modplug/?rev=207&view=rev Author: relabsoluness Date: 2008-03-25 13:15:39 -0700 (Tue, 25 Mar 2008) Log Message: ----------- . Fix to continuous scroll fixbug (bug introduced in rev. 202) . Fix to possible memory corruption problem on handling VST with more than 30 outputs. (Thanks to Markus for pointing this out) - VST with more than 32 outputs might still be handled poorly. ? Minor tweaks in project files. Modified Paths: -------------- trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/Vstplug.h trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/unlha/unlha.vcproj trunk/OpenMPT/unrar/UNRAR.vcproj trunk/OpenMPT/unzip/unzip.vcproj trunk/OpenMPT/xsoundlib/xsoundlib.vcproj Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2008-03-19 20:38:12 UTC (rev 206) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2008-03-25 20:15:39 UTC (rev 207) @@ -273,7 +273,7 @@ if ((int)row < (int)0) row += pSndFile->PatternSize[m_nPattern]; row %= pSndFile->PatternSize[m_nPattern]; } - } else + } else //row >= 0 if (row >= pSndFile->PatternSize[m_nPattern]) { if (m_dwStatus & (PATSTATUS_KEYDRAGSEL|PATSTATUS_MOUSEDRAGSEL)) @@ -289,9 +289,10 @@ const PATTERNINDEX nextPat = pSndFile->Order[nextOrder]; if ((nextPat < pSndFile->Patterns.Size()) && (pSndFile->PatternSize[nextPat])) { + const ROWINDEX newRow = row - pSndFile->PatternSize[m_nPattern]; SendCtrlMessage(CTRLMSG_SETCURRENTORDER, nextOrder); if (SetCurrentPattern(nextPat)) - return SetCurrentRow(row - pSndFile->PatternSize[m_nPattern]); + return SetCurrentRow(newRow); } } row = pSndFile->PatternSize[m_nPattern]-1; Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2008-03-19 20:38:12 UTC (rev 206) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2008-03-25 20:15:39 UTC (rev 207) @@ -1579,6 +1579,16 @@ m_nInputs = m_pEffect->numInputs; m_nOutputs = m_pEffect->numOutputs; + + //32 is the maximum output count due to the size of m_FloatBuffer. + //TODO: How to handle properly plugs with numOutputs > 32? + if(m_nOutputs > 32) + { + m_nOutputs = 32; + CString str; + str.Format("Plugin has unsupported number(=%d) of outputs; plugin may malfunction.", m_pEffect->numOutputs); + MessageBox(NULL, str, "Warning", MB_ICONWARNING); + } //input pointer array size must be >=2 for now - the input buffer assignment might write to non allocated mem. otherwise m_pInputs = (m_nInputs >= 2) ? new (float *[m_nInputs]) : new (float*[2]); @@ -1590,7 +1600,7 @@ for (UINT iOut=0; iOut<m_nOutputs; iOut++) { - m_pTempBuffer[iOut]=(float *)((((DWORD)&m_FloatBuffer[MIXBUFFERSIZE*(2+iOut)])+7)&~7); //rewbs.dryRatio + m_pTempBuffer[iOut]=(float *)((((DWORD_PTR)&m_FloatBuffer[MIXBUFFERSIZE*(2+iOut)])+7)&~7); //rewbs.dryRatio } #ifdef VST_LOG Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2008-03-19 20:38:12 UTC (rev 206) +++ trunk/OpenMPT/mptrack/Vstplug.h 2008-03-25 20:15:39 UTC (rev 207) @@ -75,7 +75,7 @@ float **m_pOutputs; int m_nEditorX, m_nEditorY; int m_MixBuffer[MIXBUFFERSIZE*2+2]; // Stereo interleaved - float m_FloatBuffer[MIXBUFFERSIZE*32+31]; // 2ch separated + up to 32 VSTi outputs... + float m_FloatBuffer[MIXBUFFERSIZE*(2+32)+31]; // 2ch separated + up to 32 VSTi outputs... VstMidiEvent m_ev_queue[VSTEVENT_QUEUE_LEN]; CModDoc* m_pModDoc; //rewbs.plugDocAware CSoundFile* m_pSndFile; //rewbs.plugDocAware Modified: trunk/OpenMPT/mptrack/mptrack.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack.vcproj 2008-03-19 20:38:12 UTC (rev 206) +++ trunk/OpenMPT/mptrack/mptrack.vcproj 2008-03-25 20:15:39 UTC (rev 207) @@ -27,8 +27,11 @@ AdditionalIncludeDirectories="..\unlha,..\unzip,..\unrar,..\soundlib,..\include,..\xsoundlib" PreprocessorDefinitions="_DEBUG,WIN32,_WINDOWS,ENABLE_EQ,MODPLUG_TRACKER,NO_PACKING,HAVE_DOT_NET,ENABLE_AMD,ENABLE_SSE,ENABLE_AMDNOW,ENABLE_MMX" StringPooling="TRUE" + BasicRuntimeChecks="3" RuntimeLibrary="1" + BufferSecurityCheck="TRUE" EnableFunctionLevelLinking="TRUE" + ForceConformanceInForLoopScope="TRUE" UsePrecompiledHeader="3" PrecompiledHeaderThrough="stdafx.h" PrecompiledHeaderFile=".\Debug/mptrack.pch" @@ -37,7 +40,7 @@ ProgramDataBaseFileName=".\Debug/" BrowseInformation="1" WarningLevel="4" - SuppressStartupBanner="TRUE" + SuppressStartupBanner="FALSE" DebugInformationFormat="4" CompileAs="0"/> <Tool @@ -92,11 +95,12 @@ IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" UseOfMFC="1" - ATLMinimizesCRunTimeLibraryUsage="FALSE"> + ATLMinimizesCRunTimeLibraryUsage="FALSE" + WholeProgramOptimization="TRUE"> <Tool Name="VCCLCompilerTool" - AdditionalOptions="/EHsc" - Optimization="3" + AdditionalOptions="/EHsc /O2" + Optimization="2" GlobalOptimizations="TRUE" InlineFunctionExpansion="2" OptimizeForWindowsApplication="TRUE" @@ -104,7 +108,7 @@ PreprocessorDefinitions="NDEBUG,WIN32,_WINDOWS,ENABLE_MMX,ENABLE_EQ,MODPLUG_TRACKER,NO_PACKING,HAVE_DOT_NET,ENABLE_AMD,ENABLE_SSE,ENABLE_AMDNOW" StringPooling="TRUE" RuntimeLibrary="0" - BufferSecurityCheck="FALSE" + BufferSecurityCheck="TRUE" EnableFunctionLevelLinking="FALSE" UsePrecompiledHeader="3" PrecompiledHeaderThrough="stdafx.h" @@ -113,7 +117,7 @@ ObjectFile=".\Generic/" ProgramDataBaseFileName=".\Generic/" WarningLevel="3" - SuppressStartupBanner="TRUE" + SuppressStartupBanner="FALSE" CompileAs="0"/> <Tool Name="VCCustomBuildTool"/> @@ -137,8 +141,7 @@ TargetEnvironment="1" TypeLibraryName=".\Bin/mptrack.tlb"/> <Tool - Name="VCPostBuildEventTool" - CommandLine="perl $(TargetDir)/getVersionFromCode.pl > $(TargetDir)/version"/> + Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool @@ -706,21 +709,6 @@ RelativePath="..\soundlib\Tables.cpp"> </File> <File - RelativePath="..\soundlib\tuning.cpp"> - </File> - <File - RelativePath="..\soundlib\tuningbase.cpp"> - </File> - <File - RelativePath="..\soundlib\tuningCollection.cpp"> - </File> - <File - RelativePath=".\TuningDialog.cpp"> - </File> - <File - RelativePath=".\tuningRatioMapWnd.cpp"> - </File> - <File RelativePath=".\view_com.cpp"> </File> <File @@ -848,6 +836,25 @@ RelativePath=".\view_graph.h"> </File> </Filter> + <Filter + Name="Tuning" + Filter=""> + <File + RelativePath="..\soundlib\tuning.cpp"> + </File> + <File + RelativePath="..\soundlib\tuningbase.cpp"> + </File> + <File + RelativePath="..\soundlib\tuningCollection.cpp"> + </File> + <File + RelativePath=".\TuningDialog.cpp"> + </File> + <File + RelativePath=".\tuningRatioMapWnd.cpp"> + </File> + </Filter> </Filter> <Filter Name="Resource Files" @@ -983,6 +990,9 @@ RelativePath=".\MainFrm.h"> </File> <File + RelativePath="..\soundlib\midi.h"> + </File> + <File RelativePath=".\MIDIMappingDialog.h"> </File> <File @@ -995,6 +1005,9 @@ RelativePath=".\mod2wave.h"> </File> <File + RelativePath="..\soundlib\mod_specifications.h"> + </File> + <File RelativePath="..\soundlib\modcommand.h"> </File> <File @@ -1022,6 +1035,9 @@ RelativePath=".\OpenGLEditor.h"> </File> <File + RelativePath=".\order.h"> + </File> + <File RelativePath=".\OrderToPatternTable.h"> </File> <File @@ -1034,6 +1050,9 @@ RelativePath=".\PatternGotoDialog.h"> </File> <File + RelativePath="..\soundlib\patternset.h"> + </File> + <File RelativePath=".\PerformanceCounter.h"> </File> <File @@ -1067,21 +1086,6 @@ RelativePath=".\StdAfx.h"> </File> <File - RelativePath="..\soundlib\tuning.h"> - </File> - <File - RelativePath="..\soundlib\tuningbase.h"> - </File> - <File - RelativePath="..\soundlib\tuningcollection.h"> - </File> - <File - RelativePath=".\TuningDialog.h"> - </File> - <File - RelativePath=".\tuningRatioMapWnd.h"> - </File> - <File RelativePath=".\typedefs.h"> </File> <File @@ -1109,8 +1113,30 @@ RelativePath=".\vstplug.h"> </File> <File + RelativePath="..\soundlib\wavConverter.h"> + </File> + <File RelativePath="..\soundlib\WindowedFIR.h"> </File> + <Filter + Name="tuning" + Filter=""> + <File + RelativePath="..\soundlib\tuning.h"> + </File> + <File + RelativePath="..\soundlib\tuningbase.h"> + </File> + <File + RelativePath="..\soundlib\tuningcollection.h"> + </File> + <File + RelativePath=".\TuningDialog.h"> + </File> + <File + RelativePath=".\tuningRatioMapWnd.h"> + </File> + </Filter> </Filter> <File RelativePath=".\mptrack.reg"> Modified: trunk/OpenMPT/unlha/unlha.vcproj =================================================================== --- trunk/OpenMPT/unlha/unlha.vcproj 2008-03-19 20:38:12 UTC (rev 206) +++ trunk/OpenMPT/unlha/unlha.vcproj 2008-03-25 20:15:39 UTC (rev 207) @@ -25,6 +25,7 @@ StringPooling="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="1" + BufferSecurityCheck="TRUE" EnableFunctionLevelLinking="TRUE" PrecompiledHeaderFile=".\Debug/unlha.pch" AssemblerListingLocation=".\Debug/" @@ -70,18 +71,20 @@ CharacterSet="2"> <Tool Name="VCCLCompilerTool" + AdditionalOptions="/O1" Optimization="1" InlineFunctionExpansion="1" PreprocessorDefinitions="WIN32;NDEBUG;_LIB" StringPooling="TRUE" RuntimeLibrary="0" + BufferSecurityCheck="TRUE" EnableFunctionLevelLinking="TRUE" PrecompiledHeaderFile=".\Release/unlha.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" WarningLevel="3" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="FALSE"/> <Tool Name="VCCustomBuildTool"/> <Tool Modified: trunk/OpenMPT/unrar/UNRAR.vcproj =================================================================== --- trunk/OpenMPT/unrar/UNRAR.vcproj 2008-03-19 20:38:12 UTC (rev 206) +++ trunk/OpenMPT/unrar/UNRAR.vcproj 2008-03-25 20:15:39 UTC (rev 207) @@ -23,6 +23,7 @@ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="1" + BufferSecurityCheck="TRUE" EnableFunctionLevelLinking="TRUE" PrecompiledHeaderFile=".\Debug/UNRAR.pch" AssemblerListingLocation=".\Debug/" @@ -66,18 +67,20 @@ ATLMinimizesCRunTimeLibraryUsage="FALSE"> <Tool Name="VCCLCompilerTool" + AdditionalOptions="/O1" Optimization="1" InlineFunctionExpansion="1" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="0" + BufferSecurityCheck="TRUE" EnableFunctionLevelLinking="TRUE" PrecompiledHeaderFile=".\Release/UNRAR.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" WarningLevel="3" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="FALSE"/> <Tool Name="VCCustomBuildTool"/> <Tool Modified: trunk/OpenMPT/unzip/unzip.vcproj =================================================================== --- trunk/OpenMPT/unzip/unzip.vcproj 2008-03-19 20:38:12 UTC (rev 206) +++ trunk/OpenMPT/unzip/unzip.vcproj 2008-03-25 20:15:39 UTC (rev 207) @@ -23,6 +23,7 @@ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="1" + BufferSecurityCheck="TRUE" EnableFunctionLevelLinking="TRUE" PrecompiledHeaderFile=".\Debug/unzip.pch" AssemblerListingLocation=".\Debug/" @@ -66,18 +67,20 @@ ATLMinimizesCRunTimeLibraryUsage="FALSE"> <Tool Name="VCCLCompilerTool" + AdditionalOptions="/O1" Optimization="1" InlineFunctionExpansion="1" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" StringPooling="TRUE" RuntimeLibrary="0" + BufferSecurityCheck="TRUE" EnableFunctionLevelLinking="TRUE" PrecompiledHeaderFile=".\Release/unzip.pch" AssemblerListingLocation=".\Release/" ObjectFile=".\Release/" ProgramDataBaseFileName=".\Release/" WarningLevel="3" - SuppressStartupBanner="TRUE"/> + SuppressStartupBanner="FALSE"/> <Tool Name="VCCustomBuildTool"/> <Tool Modified: trunk/OpenMPT/xsoundlib/xsoundlib.vcproj =================================================================== --- trunk/OpenMPT/xsoundlib/xsoundlib.vcproj 2008-03-19 20:38:12 UTC (rev 206) +++ trunk/OpenMPT/xsoundlib/xsoundlib.vcproj 2008-03-25 20:15:39 UTC (rev 207) @@ -23,6 +23,7 @@ MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="5" + BufferSecurityCheck="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="TRUE" @@ -59,10 +60,13 @@ CharacterSet="2"> <Tool Name="VCCLCompilerTool" + AdditionalOptions="/O2" PreprocessorDefinitions="WIN32;NDEBUG;_LIB" RuntimeLibrary="4" + BufferSecurityCheck="TRUE" UsePrecompiledHeader="3" WarningLevel="3" + SuppressStartupBanner="FALSE" Detect64BitPortabilityProblems="TRUE" DebugInformationFormat="3"/> <Tool This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2008-04-05 20:56:24
|
Revision: 209 http://modplug.svn.sourceforge.net/modplug/?rev=209&view=rev Author: relabsoluness Date: 2008-04-05 13:56:19 -0700 (Sat, 05 Apr 2008) Log Message: ----------- . Fix to faulty plug file existence check (http://lpchip.com/modplug/viewtopic.php?t=2255) . Sound card-options buffer length value validation. . In .51, muted channels were ignored completely in MIDI export. Now pattern effects are processed in muted channels. . IT style-playback fix Modified Paths: -------------- trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/misc_util.cpp trunk/OpenMPT/mptrack/misc_util.h trunk/OpenMPT/mptrack/mod2midi.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2008-03-29 16:08:03 UTC (rev 208) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2008-04-05 20:56:19 UTC (rev 209) @@ -329,8 +329,16 @@ CHAR s[32]; m_CbnBufferLength.GetWindowText(s, sizeof(s)); m_nBufferLength = atoi(s); - //if ((m_nBufferLength < 10) || (m_nBufferLength > 200)) m_nBufferLength = 100; - if ((m_nBufferLength < SNDDEV_MINBUFFERLEN) || (m_nBufferLength > SNDDEV_MAXBUFFERLEN)) m_nBufferLength = 100; + //Check given value. + if(m_nBufferLength < SNDDEV_MINBUFFERLEN) + m_nBufferLength = SNDDEV_MINBUFFERLEN; + else + { + if(m_nBufferLength > SNDDEV_MAXBUFFERLEN) + m_nBufferLength = SNDDEV_MAXBUFFERLEN; + } + wsprintf(s, "%d ms", m_nBufferLength); + m_CbnBufferLength.SetWindowText(s); } // Soft Panning if (m_dwSoundSetup & SOUNDSETUP_SOFTPANNING) Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2008-03-29 16:08:03 UTC (rev 208) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2008-04-05 20:56:19 UTC (rev 209) @@ -1,6 +1,7 @@ #include "stdafx.h" #include <uuids.h> #include <dmoreg.h> +#include <shlwapi.h> #include <medparam.h> #include "mptrack.h" #include "mainfrm.h" @@ -162,7 +163,7 @@ PVSTPLUGINLIB CVstPluginManager::AddPlugin(LPCSTR pszDllPath, BOOL bCache, const bool checkFileExistence, CString* const errStr) //----------------------------------------------------------------------------------------------------------- { - if(checkFileExistence && !DoesFileExist(pszDllPath)) + if(checkFileExistence && (PathFileExists(pszDllPath) == FALSE)) { if(errStr) { Modified: trunk/OpenMPT/mptrack/misc_util.cpp =================================================================== --- trunk/OpenMPT/mptrack/misc_util.cpp 2008-03-29 16:08:03 UTC (rev 208) +++ trunk/OpenMPT/mptrack/misc_util.cpp 2008-04-05 20:56:19 UTC (rev 209) @@ -1,17 +1,3 @@ #include "stdafx.h" #include "misc_util.h" -bool DoesFileExist(const char* const filepath) -//-------------------------------------------- -{ - char path_buffer[_MAX_PATH]; - char drive[_MAX_DRIVE]; - char dir[_MAX_DIR]; - char fname[_MAX_FNAME]; - char ext[_MAX_EXT]; - - LPTSTR* p = 0; - _splitpath(filepath, drive, dir, fname, ext); - _makepath(path_buffer, drive, dir, NULL, NULL); - return (SearchPath(path_buffer, fname, ext, 0, 0, p) != 0); -} Modified: trunk/OpenMPT/mptrack/misc_util.h =================================================================== --- trunk/OpenMPT/mptrack/misc_util.h 2008-03-29 16:08:03 UTC (rev 208) +++ trunk/OpenMPT/mptrack/misc_util.h 2008-04-05 20:56:19 UTC (rev 209) @@ -35,8 +35,5 @@ */ } -//Return true if file with given path is found. -bool DoesFileExist(const char* const filepath); - #endif Modified: trunk/OpenMPT/mptrack/mod2midi.cpp =================================================================== --- trunk/OpenMPT/mptrack/mod2midi.cpp 2008-03-29 16:08:03 UTC (rev 208) +++ trunk/OpenMPT/mptrack/mod2midi.cpp 2008-04-05 20:56:19 UTC (rev 209) @@ -432,72 +432,73 @@ } for (UINT nChn=0; nChn<chnCount; nChn++) { - //Skip muted channels. - if(m_pSndFile->ChnSettings[nChn].dwFlags & CHN_MUTE) continue; - PDYNMIDITRACK pTrk = &Tracks[nChn]; MODCOMMAND *m = m_pSndFile->Patterns[nPat].GetpModCommand(nRow, nChn); UINT delta_time = nClock - pTrk->nLastEventClock; UINT len = 0; - // Instrument change - if ((m->instr) && (m->instr != pTrk->nInstrument) && (m->instr < MAX_SAMPLES)) + //Process note data only in non-muted channels. + if((m_pSndFile->ChnSettings[nChn].dwFlags & CHN_MUTE) == 0) { - UINT nIns = m->instr; - UINT nMidiCh = m_InstrMap[nIns].nChannel; - UINT nProgram = m_InstrMap[nIns].nProgram; - if ((nMidiCh) && (nMidiCh <= 16)) nMidiCh--; - else nMidiCh = nChn&7; - pTrk->nMidiChannel = nMidiCh; - pTrk->nMidiProgram = nProgram; - pTrk->nInstrument = nIns; - if ((nMidiCh != 9) && (nProgram != nMidiChCurPrg[nMidiCh])) + // Instrument change + if ((m->instr) && (m->instr != pTrk->nInstrument) && (m->instr < MAX_SAMPLES)) { - tmp[len] = 0xC0|nMidiCh; - tmp[len+1] = nProgram; - tmp[len+2] = 0; - len += 3; - } - } - // Note change - if (m->note) - { - UINT note = m->note - 1; - for (UINT i=0; i<128; i++) - { - if (pTrk->NoteOn[i]) + UINT nIns = m->instr; + UINT nMidiCh = m_InstrMap[nIns].nChannel; + UINT nProgram = m_InstrMap[nIns].nProgram; + if ((nMidiCh) && (nMidiCh <= 16)) nMidiCh--; + else nMidiCh = nChn&7; + pTrk->nMidiChannel = nMidiCh; + pTrk->nMidiProgram = nProgram; + pTrk->nInstrument = nIns; + if ((nMidiCh != 9) && (nProgram != nMidiChCurPrg[nMidiCh])) { - tmp[len] = 0x90|(pTrk->NoteOn[i]-1); - tmp[len+1] = i; + tmp[len] = 0xC0|nMidiCh; + tmp[len+1] = nProgram; tmp[len+2] = 0; - tmp[len+3] = 0; - len += 4; - pTrk->NoteOn[i] = 0; + len += 3; } } - if (m->note <= 120) + // Note change + if (m->note) { - pTrk->NoteOn[note] = pTrk->nMidiChannel+1; - tmp[len] = 0x90|pTrk->nMidiChannel; - tmp[len+1] = (pTrk->nMidiChannel==9) ? pTrk->nMidiProgram : note; - UINT vol = 0x7f; - UINT nsmp = pTrk->nInstrument; - if (m_pSndFile->m_nInstruments) + UINT note = m->note - 1; + for (UINT i=0; i<128; i++) { - if ((nsmp < MAX_INSTRUMENTS) && (m_pSndFile->Headers[nsmp])) + if (pTrk->NoteOn[i]) { - INSTRUMENTHEADER *penv = m_pSndFile->Headers[nsmp]; - nsmp = penv->Keyboard[note]; - } else nsmp = 0; + tmp[len] = 0x90|(pTrk->NoteOn[i]-1); + tmp[len+1] = i; + tmp[len+2] = 0; + tmp[len+3] = 0; + len += 4; + pTrk->NoteOn[i] = 0; + } } - if ((nsmp) && (nsmp < MAX_SAMPLES)) vol = m_pSndFile->Ins[nsmp].nVolume; - if (m->volcmd == VOLCMD_VOLUME) vol = m->vol*4; - if (m->command == CMD_VOLUME) vol = m->param*4; - vol = LinearToDLSMidiVolume(vol<<8); - if (vol > 0x7f) vol = 0x7f; - tmp[len+2] = (BYTE)vol; - tmp[len+3] = 0; - len += 4; + if (m->note <= 120) + { + pTrk->NoteOn[note] = pTrk->nMidiChannel+1; + tmp[len] = 0x90|pTrk->nMidiChannel; + tmp[len+1] = (pTrk->nMidiChannel==9) ? pTrk->nMidiProgram : note; + UINT vol = 0x7f; + UINT nsmp = pTrk->nInstrument; + if (m_pSndFile->m_nInstruments) + { + if ((nsmp < MAX_INSTRUMENTS) && (m_pSndFile->Headers[nsmp])) + { + INSTRUMENTHEADER *penv = m_pSndFile->Headers[nsmp]; + nsmp = penv->Keyboard[note]; + } else nsmp = 0; + } + if ((nsmp) && (nsmp < MAX_SAMPLES)) vol = m_pSndFile->Ins[nsmp].nVolume; + if (m->volcmd == VOLCMD_VOLUME) vol = m->vol*4; + if (m->command == CMD_VOLUME) vol = m->param*4; + vol = LinearToDLSMidiVolume(vol<<8); + if (vol > 0x7f) vol = 0x7f; + tmp[len+2] = (BYTE)vol; + tmp[len+3] = 0; + len += 4; + } } } // Effects Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2008-03-29 16:08:03 UTC (rev 208) +++ trunk/OpenMPT/mptrack/mptrack.rc 2008-04-05 20:56:19 UTC (rev 209) @@ -1946,7 +1946,7 @@ // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,17,2,51 + FILEVERSION 1,17,2,52 PRODUCTVERSION 0,0,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG @@ -1964,7 +1964,7 @@ BEGIN VALUE "CompanyName", "Olivier Lapicque / OpenMPT team" VALUE "FileDescription", "OpenMPT / ModPlug Tracker" - VALUE "FileVersion", "1, 17, 2, 51" + VALUE "FileVersion", "1, 17, 2, 52" VALUE "InternalName", "Modplug Tracker" VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2007 GPL." VALUE "LegalTrademarks", "M.O.D.P.L.U.G" Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2008-03-29 16:08:03 UTC (rev 208) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2008-04-05 20:56:19 UTC (rev 209) @@ -615,12 +615,13 @@ pChn->dwFlags |= (CHN_NOTEFADE|CHN_FASTVOLRAMP); if ((!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) || (m_nInstruments)) pChn->nVolume = 0; pChn->nFadeOutVol = 0; + } - //IT compatibility tentative fix: Clear channel note memory on note cut. - if(TypeIsIT_MPT() && GetModFlag(MSF_IT_COMPATIBLE_PLAY)) - { - pChn->nNote = pChn->nNewNote = 0; - } + //IT compatibility tentative fix: Clear channel note memory. + if(TypeIsIT_MPT() && GetModFlag(MSF_IT_COMPATIBLE_PLAY)) + { + pChn->nNote = 0; + pChn->nNewNote = 0; } return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2008-05-10 13:28:05
|
Revision: 211 http://modplug.svn.sourceforge.net/modplug/?rev=211&view=rev Author: relabsoluness Date: 2008-05-10 06:27:55 -0700 (Sat, 10 May 2008) Log Message: ----------- . Fix to crash when loading samples in sample tab; occurs usually with big samples. . Fix to assigning wrong size to orderlist in COrderToPatternTable::OnModTypeChanged. Can(?) cause crashes or other problems at least when saving XM files. Bug was introduced in rev. 199, thus existing in builds .51 and .52. . Fixes to modspecifications Internal: / Some minor modifications e.g. to remove compiler warnings in VC2008. Modified Paths: -------------- trunk/OpenMPT/mptrack/AutoSaver.cpp trunk/OpenMPT/mptrack/CreditStatic.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/OrderToPatternTable.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_stm.cpp trunk/OpenMPT/soundlib/Load_umx.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.cpp 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2008-05-10 13:27:55 UTC (rev 211) @@ -223,7 +223,7 @@ { // We do not call CModDoc::DoSave as this populates the Recent Files // list with backups... hence we have duplicated code.. :( - bool success=false; + BOOL success=false; CSoundFile* pSndFile = pModDoc->GetSoundFile(); if (pSndFile) { @@ -252,7 +252,7 @@ //Do nothing } } - return success; + return (success == TRUE); } void CAutoSaver::CleanUpBackups(CModDoc *pModDoc) @@ -354,7 +354,7 @@ m_pAutoSaver->SetFilenameTemplate(""); //TODO m_pAutoSaver->SetHistoryDepth(GetDlgItemInt(IDC_AUTOSAVE_HISTORY)); m_pAutoSaver->SetSaveInterval(GetDlgItemInt(IDC_AUTOSAVE_INTERVAL)); - m_pAutoSaver->SetUseOriginalPath(IsDlgButtonChecked(IDC_AUTOSAVE_USEORIGDIR)); + m_pAutoSaver->SetUseOriginalPath(IsDlgButtonChecked(IDC_AUTOSAVE_USEORIGDIR) == BST_CHECKED); GetDlgItemText(IDC_AUTOSAVE_PATH, tempPath); if (!tempPath.IsEmpty() && (tempPath.Right(1)!="\\")) tempPath.Append("\\"); @@ -385,7 +385,7 @@ void CAutoSaverGUI::OnBnClickedAutosaveEnable() { - bool enabled = IsDlgButtonChecked(IDC_AUTOSAVE_ENABLE); + BOOL enabled = IsDlgButtonChecked(IDC_AUTOSAVE_ENABLE); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_AUTOSAVE_INTERVAL), enabled); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_AUTOSAVE_HISTORY), enabled); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_AUTOSAVE_USEORIGDIR), enabled); @@ -399,7 +399,7 @@ void CAutoSaverGUI::OnBnClickedAutosaveUseorigdir() { if (IsDlgButtonChecked(IDC_AUTOSAVE_ENABLE)) { - bool enabled = IsDlgButtonChecked(IDC_AUTOSAVE_USEORIGDIR); + BOOL enabled = IsDlgButtonChecked(IDC_AUTOSAVE_USEORIGDIR); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_AUTOSAVE_PATH), !enabled); ::EnableWindow(::GetDlgItem(m_hWnd, IDC_AUTOSAVE_BROWSE), !enabled); OnSettingsChanged(); Modified: trunk/OpenMPT/mptrack/CreditStatic.cpp =================================================================== --- trunk/OpenMPT/mptrack/CreditStatic.cpp 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/mptrack/CreditStatic.cpp 2008-05-10 13:27:55 UTC (rev 211) @@ -113,13 +113,13 @@ ASSERT(credits); - if((str = strdup(credits)) == NULL) + if((str = _tcsdup(credits)) == NULL) return; m_ArrCredit.RemoveAll(); ptr1 = str; - while((ptr2 = strchr(ptr1,delimiter)) != NULL) { + while((ptr2 = _tcschr(ptr1,delimiter)) != NULL) { *ptr2 = '\0'; m_ArrCredit.AddTail(ptr1); ptr1 = ptr2+1; Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2008-05-10 13:27:55 UTC (rev 211) @@ -53,9 +53,9 @@ { if (lpszPathName) { - CHAR s[_MAX_EXT]; - _splitpath(lpszPathName, NULL, NULL, NULL, s); - if (!stricmp(s, ".dll")) + TCHAR s[_MAX_EXT]; + _tsplitpath(lpszPathName, NULL, NULL, NULL, s); + if (!_tcsicmp(s, _TEXT(".dll"))) { CVstPluginManager *pPluginManager = theApp.GetPluginManager(); if (pPluginManager) @@ -696,7 +696,7 @@ if (m_pszProfileName) { free((void *)m_pszProfileName); } - m_pszProfileName = strdup(m_szConfigFileName); + m_pszProfileName = _tcsdup(m_szConfigFileName); LoadStdProfileSettings(10); // Load standard INI file options (including MRU) @@ -1483,8 +1483,8 @@ -97, -92, -86, -80, -74, -68, -62, -56, -49, -43, -37, -31, -25, -18, -12, -6 }; -#define Sinus(x) __SinusTable[x&0xFF] -#define Cosinus(x) __SinusTable[(x+0x40)&0xFF] +#define Sinus(x) __SinusTable[(x)&0xFF] +#define Cosinus(x) __SinusTable[((x)+0x40)&0xFF] #define PI 3.14159265358979323f BOOL CPaletteBitmap::Animate() Modified: trunk/OpenMPT/mptrack/OrderToPatternTable.cpp =================================================================== --- trunk/OpenMPT/mptrack/OrderToPatternTable.cpp 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/mptrack/OrderToPatternTable.cpp 2008-05-10 13:27:55 UTC (rev 211) @@ -94,11 +94,11 @@ { const CModSpecifications specs = m_rSndFile.GetModSpecifications(); - //Resize orderlist if needed. Because old orderlist had 256 elements, not making it + //Resize orderlist if needed. Because old orderlist had MAX_ORDERS(256) elements, not making it //smaller than that even if the modtype doesn't support that many orders. if(specs.ordersMax < GetCount()) { - resize(max(MAX_PATTERNS, specs.ordersMax)); + resize(max(MAX_ORDERS, specs.ordersMax)); for(ORDERINDEX i = GetCount(); i>specs.ordersMax; --i) (*this)[i-1] = GetInvalidPatIndex(); } Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2008-05-10 13:27:55 UTC (rev 211) @@ -595,7 +595,9 @@ int smplsize, oldsmin, oldsmax; int yrange = cy/2; signed char *psample = (signed char *)pSampleData; - int y0 = 0, xmax, posincr, posfrac, poshi; + //int y0 = 0, xmax, posincr, posfrac, poshi; + int32 y0 = 0, xmax, poshi; + uint64 posincr, posfrac; if (len <= 0) return; smplsize = (uFlags & CHN_16BIT) ? 2 : 1; @@ -612,21 +614,24 @@ { xmax = len>>(m_nZoom-1); if (xmax > cx) xmax = cx; - posincr = 1<<(m_nZoom-1+16); + posincr = (uint64(1) << (m_nZoom-1+16)); } else { xmax = cx; - posincr = _muldiv(len, 0x10000, cx); + //posincr = _muldiv(len, 0x10000, cx); + posincr = uint64(len) * uint64(0x10000) / uint64(cx); } ::MoveToEx(hdc, 0, ymed, NULL); posfrac = 0; poshi = 0; for (int x=0; x<xmax; x++) { - int smin, smax, scanlen; + //int smin, smax, scanlen; + int smin, smax; + int32 scanlen; posfrac += posincr; - scanlen = (posfrac+0xffff) >> 16; + scanlen = static_cast<int32>((posfrac+0xffff) >> 16); if (poshi >= len) poshi = len-1; if (poshi+scanlen > len) scanlen = len-poshi; if (scanlen < 1) scanlen = 1; @@ -692,7 +697,7 @@ ::LineTo(hdc, x, smin); oldsmin = smin; oldsmax = smax; - poshi += (posfrac>>16); + poshi += static_cast<int32>(posfrac>>16); posfrac &= 0xffff; } } @@ -2320,4 +2325,4 @@ } return NULL; -} \ No newline at end of file +} Modified: trunk/OpenMPT/soundlib/Load_mid.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mid.cpp 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/soundlib/Load_mid.cpp 2008-05-10 13:27:55 UTC (rev 211) @@ -763,7 +763,7 @@ CHAR s[32]; memcpy(s, ptrk->ptracks, k); s[k] = 0; - if ((!strnicmp(s, "Copyri", 6)) || (!s[0])) break; + if ((!_strnicmp(s, "Copyri", 6)) || (!s[0])) break; if (i == 0x03) { if (!m_szNames[0][0]) strcpy(m_szNames[0], s); Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2008-05-10 13:27:55 UTC (rev 211) @@ -348,7 +348,7 @@ LPSTR p = (LPSTR)(lpStream+dwMemPos); UINT flags = 0; if (dwMemPos + 5 >= dwMemLength) break; - if (!strnicmp(p, "ADPCM", 5)) + if (!_strnicmp(p, "ADPCM", 5)) { flags = 3; p += 5; Modified: trunk/OpenMPT/soundlib/Load_stm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_stm.cpp 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/soundlib/Load_stm.cpp 2008-05-10 13:27:55 UTC (rev 211) @@ -67,8 +67,8 @@ if ((!lpStream) || (dwMemLength < sizeof(STMHEADER))) return FALSE; if ((phdr->filetype != 2) || (phdr->unused != 0x1A) - || ((strnicmp(phdr->trackername, "!SCREAM!", 8)) - && (strnicmp(phdr->trackername, "BMOD2STM", 8)))) return FALSE; + || ((_strnicmp(phdr->trackername, "!SCREAM!", 8)) + && (_strnicmp(phdr->trackername, "BMOD2STM", 8)))) return FALSE; memcpy(m_szNames[0], phdr->songname, 20); // Read STM header m_nType = MOD_TYPE_STM; Modified: trunk/OpenMPT/soundlib/Load_umx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_umx.cpp 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/soundlib/Load_umx.cpp 2008-05-10 13:27:55 UTC (rev 211) @@ -38,7 +38,7 @@ return ReadS3M(lpStream + dwRipOfs, dwMemLength - dwRipOfs); } // XM - if (!strnicmp((LPCSTR)(lpStream+uscan), "Extended Module", 15)) + if (!_strnicmp((LPCSTR)(lpStream+uscan), "Extended Module", 15)) { DWORD dwRipOfs = uscan; return ReadXM(lpStream + dwRipOfs, dwMemLength - dwRipOfs); Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2008-05-10 13:27:55 UTC (rev 211) @@ -680,6 +680,9 @@ header.norder++; if ((Order[i] >= header.patterns) && (Order[i] < MAX_PATTERNS)) header.patterns = Order[i]+1; }*/ + if(Order.GetCount() < MAX_ORDERS) + Order.resize(MAX_ORDERS, Order.GetInvalidPatIndex()); + for (i=MAX_ORDERS-1; i>=0; i--) { // walk backwards over orderlist if ((Order[i]!=0xFF) && (header.norder==0)) { header.norder=i+1; //find last used order Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2008-04-13 21:53:04 UTC (rev 210) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2008-05-10 13:27:55 UTC (rev 211) @@ -4,6 +4,7 @@ //Simple struct to gather various modspecifications in one place. //Feel free to improve. struct CModSpecifications +//======================= { //NOTE: If changing order, update all initializations below. char fileExtension[5]; @@ -108,7 +109,7 @@ 256, //Max pattern rows 20, //Max mod name length 31, //SamplesMax - 256, //instrumentMax + 200, //instrumentMax mixLevels_original, //defaultMixLevels 0 //Max MIDI mapping directives }; @@ -118,16 +119,16 @@ { //TODO: Set correct values. "xm", //File extension - 64, //Pattern max. - 128, //Order max. + 240, //Pattern max. + 256, //Order max. 4, //Channel min - 64, //Channel max + 127, //Channel max 32, //Min tempo 512, //Max tempo 4, //Min pattern rows 1024, //Max pattern rows 20, //Max mod name length - 31, //SamplesMax + 4000, //SamplesMax 256, //instrumentMax mixLevels_117RC3, //defaultMixLevels 200 //Max MIDI mapping directives @@ -146,7 +147,7 @@ 64, //Min pattern rows 64, //Max pattern rows 27, //Max mod name length - 31, //SamplesMax + 99, //SamplesMax 0, //instrumentMax mixLevels_original, //defaultMixLevels 0 //Max MIDI mapping directives @@ -165,7 +166,7 @@ 64, //Min pattern rows 64, //Max pattern rows 27, //Max mod name length - 31, //SamplesMax + 99, //SamplesMax 0, //instrumentMax mixLevels_original, //defaultMixLevels 0 //Max MIDI mapping directives @@ -185,7 +186,7 @@ 256, //Max pattern rows 25, //Max mod name length 256, //SamplesMax - 256, //instrumentMax + 200, //instrumentMax mixLevels_original, //defaultMixLevels 0 //Max MIDI mapping directives }; @@ -212,6 +213,4 @@ - - #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2008-06-07 12:17:55
|
Revision: 212 http://modplug.svn.sourceforge.net/modplug/?rev=212&view=rev Author: relabsoluness Date: 2008-06-07 05:17:24 -0700 (Sat, 07 Jun 2008) Log Message: ----------- ./ Increased pattern index hint size from 8 bits to 12 bits. Should fix pattern name update bug when using more than 255 pattern. (http://lpchip.com/modplug/viewtopic.php?t=2344) . Refactoring and fixes to UpdateView hint parameter handling. Affects at least some treeview related GUI updates. / Show note about pre-amp setting before changing it. / Changed pattern/order limit for MPTm from 65000 to 4000. ./ Minor tweaks and fixes here and there. Internal: / Refactoring: Added defines for maximum note value and note cut/off values. / Refactoring: Moved some CCtrlPatterns code from ChannelManagerDlg.cpp to ctrl_pat.cpp Modified Paths: -------------- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/EffectVis.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Mpdlgs.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Stdafx.h trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_gen.h trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h 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/misc_util.h trunk/OpenMPT/mptrack/mod2midi.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/mptrack/pattern.cpp trunk/OpenMPT/mptrack/view_com.cpp trunk/OpenMPT/soundlib/Dlsbank.cpp trunk/OpenMPT/soundlib/LOAD_DBM.CPP trunk/OpenMPT/soundlib/Load_ams.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_mdl.cpp trunk/OpenMPT/soundlib/Load_med.cpp trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/Load_mt2.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/Sampleio.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -1,14 +1,16 @@ #include "stdafx.h" -#include "mptrack.h" #include "mainfrm.h" -#include "childfrm.h" #include "moddoc.h" -#include "globals.h" -#include "dlg_misc.h" -#include "ctrl_pat.h" -#include "view_pat.h" +#include "view_gen.h" #include "ChannelManagerDlg.h" +//#include "mptrack.h" +//#include "childfrm.h" +//#include "globals.h" +//#include "dlg_misc.h" +//#include "ctrl_pat.h" +//#include "view_pat.h" + /////////////////////////////////////////////////////////// // CChannelManagerDlg @@ -1114,7 +1116,7 @@ pModDoc->MuteChannel(n,!pModDoc->IsChannelMuted(n)); } pModDoc->SetModified(); - pModDoc->UpdateAllViews(NULL, HINT_MODCHANNELS | (n << 24)); + pModDoc->UpdateAllViews(NULL, HINT_MODCHANNELS | ((n/CHANNELS_IN_TAB) << HINT_SHIFT_CHNTAB)); break; case 1: UINT r; @@ -1132,7 +1134,7 @@ if(button == CM_BT_LEFT) pModDoc->NoFxChannel(n,FALSE); else pModDoc->NoFxChannel(n,TRUE); pModDoc->SetModified(); - pModDoc->UpdateAllViews(NULL, HINT_MODCHANNELS | (n << 24)); + pModDoc->UpdateAllViews(NULL, HINT_MODCHANNELS | ((n/CHANNELS_IN_TAB) << HINT_SHIFT_CHNTAB)); break; case 3: if(button == CM_BT_LEFT){ @@ -1174,36 +1176,7 @@ // -! NEW_FEATURE#0015 -BOOL CCtrlPatterns::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) -//-------------------------------------------------------------------- -{ - // TODO: Add your message handler code here and/or call default - if (nFlags==0) { - PostViewMessage(VIEWMSG_DOSCROLL, zDelta); - } - return CModControlDlg::OnMouseWheel(nFlags, zDelta, pt); -} - -BOOL CCtrlPatterns::OnToolTip(UINT /*id*/, NMHDR *pNMHDR, LRESULT* /*pResult*/) -//--------------------------------------------------------------------- -{ - TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR; - UINT nID =pNMHDR->idFrom; - if (pTTT->uFlags & TTF_IDISHWND) - { - // idFrom is actually the HWND of the tool - nID = ::GetDlgCtrlID((HWND)nID); - if(nID) - { - pTTT->lpszText = MAKEINTRESOURCE(nID); - pTTT->hinst = AfxGetResourceHandle(); - return(TRUE); - } - } - - return FALSE; -} void CChannelManagerDlg::OnLButtonDblClk(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -113,7 +113,7 @@ //------------------------------------------ { if (nNote == m_nNote) return TRUE; - if (nNote >= 120) return FALSE; + if (nNote >= NOTE_MAX) return FALSE; m_nNote = nNote; InvalidateRect(NULL, FALSE); return TRUE; @@ -166,7 +166,7 @@ string temp = pSndFile->GetNoteName(nPos+1, m_nInstrument); temp.resize(4); - if ((nPos >= 0) && (nPos < 120)) wsprintf(s, "%s", temp.c_str()); + if ((nPos >= 0) && (nPos < NOTE_MAX)) wsprintf(s, "%s", temp.c_str()); rect.SetRect(0, ypaint, m_cxFont, ypaint+m_cyFont); DrawButtonRect(hdc, &rect, s, FALSE, FALSE); // Mapped Note @@ -174,12 +174,12 @@ rect.left = rect.right; rect.right = m_cxFont*2-1; strcpy(s, "..."); - if ((penv) && (nPos >= 0) && (nPos < 120) && (penv->NoteMap[nPos])) + if ((penv) && (nPos >= 0) && (nPos < NOTE_MAX) && (penv->NoteMap[nPos])) { UINT n = penv->NoteMap[nPos]; - if (n == 0xFF) strcpy(s, "==="); else - if (n == 0xFE) strcpy(s, "^^^"); else - if (n <= 120) + if (n == NOTE_KEYOFF) strcpy(s, "==="); else + if (n == NOTE_NOTECUT) strcpy(s, "^^^"); else + if (n <= NOTE_MAX) { string temp = pSndFile->GetNoteName(n, m_nInstrument); temp.resize(4); @@ -200,7 +200,7 @@ rect.left = rcClient.left + m_cxFont*2+3; rect.right = rcClient.right; strcpy(s, " .."); - if ((penv) && (nPos >= 0) && (nPos < 120) && (penv->Keyboard[nPos])) + if ((penv) && (nPos >= 0) && (nPos < NOTE_MAX) && (penv->Keyboard[nPos])) { wsprintf(s, "%3d", penv->Keyboard[nPos]); } @@ -298,7 +298,7 @@ { BYTE smpused[(MAX_SAMPLES+7)/8]; memset(smpused, 0, sizeof(smpused)); - for (UINT i=1; i<120; i++) + for (UINT i=1; i<NOTE_MAX; i++) { UINT nsmp = penv->Keyboard[i]; if (nsmp < MAX_SAMPLES) smpused[nsmp>>3] |= 1 << (nsmp & 7); @@ -346,7 +346,7 @@ { BOOL bModified = FALSE; UINT n = penv->Keyboard[m_nNote]; - for (UINT i=0; i<120; i++) if (penv->Keyboard[i] != n) + for (UINT i=0; i<NOTE_MAX; i++) if (penv->Keyboard[i] != n) { penv->Keyboard[i] = n; bModified = TRUE; @@ -374,7 +374,7 @@ if (penv) { BOOL bModified = FALSE; - for (UINT i=0; i<120; i++) if (penv->NoteMap[i] != i+1) + for (UINT i=0; i<NOTE_MAX; i++) if (penv->NoteMap[i] != i+1) { penv->NoteMap[i] = i+1; bModified = TRUE; @@ -448,13 +448,13 @@ { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); INSTRUMENTHEADER *penv = pSndFile->Headers[m_nInstrument]; - if ((penv) && (m_nNote < 120)) + if ((penv) && (m_nNote < NOTE_MAX)) { if (!m_bIns && (pSndFile->m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) { UINT n = penv->NoteMap[m_nNote]; BOOL bOk = FALSE; - if ((note > 0) && (note <= 120)) + if ((note > 0) && (note <= NOTE_MAX)) { n = note; bOk = TRUE; @@ -480,7 +480,7 @@ { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); INSTRUMENTHEADER *penv = pSndFile->Headers[m_nInstrument]; - if ((penv) && (m_nNote < 120)) { + if ((penv) && (m_nNote < NOTE_MAX)) { if ((m_bIns) && (((c >= '0') && (c <= '9')) || (c == ' '))) { //in sample # column @@ -568,7 +568,7 @@ if (m_nNote > 0) { m_nNote = 0; bRedraw = TRUE; } break; case VK_NEXT: - if (m_nNote+3 < 120) { m_nNote+=3; bRedraw = TRUE; } else + if (m_nNote+3 < NOTE_MAX) { m_nNote+=3; bRedraw = TRUE; } else if (m_nNote < 119) { m_nNote = 119; bRedraw = TRUE; } break; case VK_TAB: @@ -822,7 +822,7 @@ // Pitch/Pan Separation m_SpinPPS.SetRange(-32, +32); // Pitch/Pan Center - for (UINT n=0; n<=120; n++) + for (UINT n=0; n<=NOTE_MAX; n++) { wsprintf(s, "%s%d", szNoteNames[n % 12], n/12); m_ComboPPC.SetItemData(m_ComboPPC.AddString(s), n); @@ -863,7 +863,7 @@ { m_nInstrument = nIns; m_NoteMap.SetCurrentInstrument(m_pModDoc, m_nInstrument); - UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT | HINT_ENVELOPE, NULL); + UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE, NULL); } else { // Just in case @@ -939,7 +939,7 @@ SetCurrentInstrument((lParam > 0) ? lParam : m_nInstrument); // Initial Update - if (!m_bInitialized) UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_MODTYPE, NULL); + if (!m_bInitialized) UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_MODTYPE, NULL); CChildFrame *pFrame = (CChildFrame *)GetParentFrame(); if (pFrame) PostViewMessage(VIEWMSG_LOADSTATE, (LPARAM)pFrame->GetInstrumentViewState()); @@ -1027,7 +1027,7 @@ if (dwHintMask & HINT_MIXPLUGINS) OnMixPlugChanged(); UnlockControls(); if (!(dwHintMask & (HINT_INSTRUMENT|HINT_ENVELOPE|HINT_MODTYPE))) return; - if (((dwHintMask >> 24) != m_nInstrument) && (dwHintMask & (HINT_INSTRUMENT|HINT_ENVELOPE)) && (!(dwHintMask & HINT_MODTYPE))) return; + if (((dwHintMask >> HINT_SHIFT_INS) != m_nInstrument) && (dwHintMask & (HINT_INSTRUMENT|HINT_ENVELOPE)) && (!(dwHintMask & HINT_MODTYPE))) return; LockControls(); if (!m_bInitialized) dwHintMask |= HINT_MODTYPE; if (dwHintMask & HINT_MODTYPE) @@ -1185,6 +1185,9 @@ m_CbnPluginVolumeHandling.EnableWindow(FALSE); m_CbnPluginVelocityHandling.SetCurSel(-1); m_CbnPluginVolumeHandling.SetCurSel(-1); + if(m_nInstrument > m_pSndFile->GetNumInstruments()) + SetCurrentInstrument(m_pSndFile->GetNumInstruments()); + } m_NoteMap.InvalidateRect(NULL, FALSE); } @@ -1295,7 +1298,7 @@ if (m_pModDoc) { m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES); + m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES); } } else bOk = FALSE; } @@ -1328,7 +1331,7 @@ m_pSndFile->ReadInstrumentFromSong(m_nInstrument, pSndFile, nInstr); END_CRITICAL(); m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES); + m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_ENVELOPE | HINT_INSNAMES | HINT_SMPNAMES); if (bFirst) m_pModDoc->UpdateAllViews(NULL, HINT_MODTYPE | HINT_INSNAMES | HINT_SMPNAMES); m_pModDoc->SetModified(); EndWaitCursor(); @@ -1465,13 +1468,13 @@ return; } BOOL bFirst = (pSndFile->m_nInstruments) ? FALSE : TRUE; - LONG smp = m_pModDoc->InsertInstrument(0); - if (smp > 0) + LONG ins = m_pModDoc->InsertInstrument(0); + if (ins > 0) { - SetCurrentInstrument(smp); - m_pModDoc->UpdateAllViews(NULL, (smp << 24) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE); + SetCurrentInstrument(ins); + m_pModDoc->UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE); } - if (bFirst) m_pModDoc->UpdateAllViews(NULL, (smp << 24) | HINT_MODTYPE | HINT_INSTRUMENT | HINT_INSNAMES); + if (bFirst) m_pModDoc->UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_MODTYPE | HINT_INSTRUMENT | HINT_INSNAMES); if (m_pParent) m_pParent->InstrumentChanged(m_nInstrument); } SwitchToView(); @@ -1487,13 +1490,13 @@ if ((pSndFile->m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (pSndFile->m_nInstruments > 0)) { BOOL bFirst = (pSndFile->m_nInstruments) ? FALSE : TRUE; - LONG smp = m_pModDoc->InsertInstrument(0, m_nInstrument); - if (smp > 0) + LONG ins = m_pModDoc->InsertInstrument(0, m_nInstrument); + if (ins > 0) { - SetCurrentInstrument(smp); - m_pModDoc->UpdateAllViews(NULL, (smp << 24) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE); + SetCurrentInstrument(ins); + m_pModDoc->UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE); } - if (bFirst) m_pModDoc->UpdateAllViews(NULL, (smp << 24) | HINT_MODTYPE | HINT_INSTRUMENT | HINT_INSNAMES); + if (bFirst) m_pModDoc->UpdateAllViews(NULL, (ins << HINT_SHIFT_INS) | HINT_MODTYPE | HINT_INSTRUMENT | HINT_INSNAMES); if (m_pParent) m_pParent->InstrumentChanged(m_nInstrument); } } @@ -1658,7 +1661,7 @@ // -! NEW_FEATURE#0023 memcpy(penv->name, s, 32); m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSNAMES, this); + m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSNAMES, this); } } } @@ -1993,7 +1996,7 @@ m_CbnPluginVolumeHandling.SetCurSel(penv->nPluginVolumeHandling); m_pModDoc->UpdateAllViews(NULL, HINT_MIXPLUGINS, this); - m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSNAMES, this); + m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSNAMES, this); if (penv->nMixPlug) //if we have not just set to no plugin { @@ -2007,7 +2010,7 @@ if (pPlug->pMixPlugin->isInstrument() && penv->nMidiChannel==0) { penv->nMidiChannel=1; m_pSndFile->instrumentModified[m_nInstrument-1] = TRUE; - UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT, NULL); + UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT, NULL); } return; } @@ -2425,7 +2428,7 @@ if (dlg.DoModal() == IDOK) { m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSTRUMENT, this); + m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT, this); m_NoteMap.InvalidateRect(NULL, FALSE); } } @@ -2505,7 +2508,7 @@ pInstH->SetTuning(NULL); END_CRITICAL(); m_pModDoc->SetModified(); - UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT); + UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT); return; } @@ -2533,7 +2536,7 @@ pInstH->SetTuning(&tc->GetTuning(sel)); END_CRITICAL(); m_pModDoc->SetModified(); - UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT); + UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT); return; } @@ -2559,7 +2562,7 @@ //new tuning(s) come visible. BuildTuningComboBox(); - UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT); + UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT); } @@ -2611,7 +2614,7 @@ penv->SetTuning(penv->s_DefaultTuning); END_CRITICAL(); m_pModDoc->SetModified(); - UpdateView((m_nInstrument << 24) | HINT_INSTRUMENT); + UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT); } void CCtrlInstruments::OnEnChangeEditPitchtempolock() Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -189,7 +189,7 @@ //CHAR s[8]; CHAR s[10]; - for(int i = 0 ; i < 120 ; i++){ + for(int i = 0 ; i < NOTE_MAX ; i++){ wsprintf(s, "%s%d", szNoteNames[i % 12], i/12); int n = m_CbnSplitNote.AddString(s); m_CbnSplitNote.SetItemData(n, i); @@ -338,7 +338,7 @@ { UINT nPat; if (dwHintMask&HINT_PATNAMES) { - nPat=(dwHintMask>>24)&0xFF; + nPat = (dwHintMask >> HINT_SHIFT_PAT); } else { nPat = SendViewMessage(VIEWMSG_GETCURRENTPATTERN); } @@ -378,7 +378,7 @@ return m_OrderList.GetCurrentPattern(); case CTRLMSG_PATTERNCHANGED: - UpdateView((lParam << 24) | HINT_PATNAMES, NULL); + UpdateView((lParam << HINT_SHIFT_PAT) | HINT_PATNAMES, NULL); break; case CTRLMSG_PAT_PREVINSTRUMENT: @@ -1087,7 +1087,7 @@ { m_pSndFile->SetPatternName(nPat, s); if (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, (nPat << 24) | HINT_PATNAMES, this); + m_pModDoc->UpdateAllViews(NULL, (nPat << HINT_SHIFT_PAT) | HINT_PATNAMES, this); } } } @@ -1220,4 +1220,37 @@ } -//end rewbs.instroVST \ No newline at end of file +//end rewbs.instroVST + + +BOOL CCtrlPatterns::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) +//-------------------------------------------------------------------- +{ + // TODO: Add your message handler code here and/or call default + + if (nFlags==0) { + PostViewMessage(VIEWMSG_DOSCROLL, zDelta); + } + return CModControlDlg::OnMouseWheel(nFlags, zDelta, pt); +} + +BOOL CCtrlPatterns::OnToolTip(UINT /*id*/, NMHDR *pNMHDR, LRESULT* /*pResult*/) +//--------------------------------------------------------------------- +{ + TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR; + UINT nID =pNMHDR->idFrom; + if (pTTT->uFlags & TTF_IDISHWND) + { + // idFrom is actually the HWND of the tool + nID = ::GetDlgCtrlID((HWND)nID); + if(nID) + { + pTTT->lpszText = MAKEINTRESOURCE(nID); + pTTT->hinst = AfxGetResourceHandle(); + return(TRUE); + } + } + + return FALSE; +} + Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -329,7 +329,7 @@ { m_nSample = nSmp; // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - UpdateView((m_nSample << 20) | HINT_SAMPLEINFO, NULL); + UpdateView((m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO, NULL); } if (bUpdNum) { @@ -388,7 +388,7 @@ SetCurrentSample((lParam > 0) ? lParam : m_nSample); // Initial Update // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - if (!m_bInitialized) UpdateView((m_nSample << 20) | HINT_SAMPLEINFO | HINT_MODTYPE, NULL); + if (!m_bInitialized) UpdateView((m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_MODTYPE, NULL); CChildFrame *pFrame = (CChildFrame *)GetParentFrame(); if ((pFrame) && (m_hWndView)) PostViewMessage(VIEWMSG_LOADSTATE, (LPARAM)pFrame->GetSampleViewState()); SwitchToView(); @@ -511,7 +511,8 @@ } if (!(dwHintMask & (HINT_SAMPLEINFO|HINT_MODTYPE))) return; // 05/01/05 : ericus replaced ">> 24" by ">> 20" : 4000 samples -> 12bits [see Moddoc.h] - if (((dwHintMask >> 20) != (m_nSample&0x0fff)) && (!(dwHintMask & HINT_MODTYPE))) return; + //if (((dwHintMask >> 20) != (m_nSample&0x0fff)) && (!(dwHintMask & HINT_MODTYPE))) return; + if (((dwHintMask >> HINT_SHIFT_SMP) != m_nSample) && (!(dwHintMask & HINT_MODTYPE))) return; LockControls(); if (!m_bInitialized) dwHintMask |= HINT_MODTYPE; // Updating Ranges @@ -773,7 +774,7 @@ pins->uFlags |= CHN_PANNING; } // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL); m_pModDoc->SetModified(); } return TRUE; @@ -802,7 +803,7 @@ } END_CRITICAL(); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO | HINT_SMPNAMES, NULL); m_pModDoc->SetModified(); EndWaitCursor(); return TRUE; @@ -870,14 +871,14 @@ CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); SetCurrentSample(smp); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (smp << 20) | HINT_SAMPLEINFO | HINT_SAMPLEDATA | HINT_SMPNAMES); + m_pModDoc->UpdateAllViews(NULL, (smp << HINT_SHIFT_SMP) | HINT_SAMPLEINFO | HINT_SAMPLEDATA | HINT_SMPNAMES); if ((pSndFile->m_nInstruments) && (!m_pModDoc->FindSampleParent(smp))) { if (MessageBox("This sample is not used by any instrument. Do you want to create a new instrument using this sample ?", NULL, MB_YESNO|MB_ICONQUESTION) == IDYES) { UINT nins = m_pModDoc->InsertInstrument(smp); - m_pModDoc->UpdateAllViews(NULL, (nins << 24) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE); + m_pModDoc->UpdateAllViews(NULL, (nins << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE); m_pParent->InstrumentChanged(nins); } } @@ -1065,7 +1066,7 @@ { m_pModDoc->AdjustEndOfSample(m_nSample); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, NULL); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL); m_pModDoc->SetModified(); } } @@ -1132,7 +1133,7 @@ } m_pModDoc->AdjustEndOfSample(m_nSample); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, NULL); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL); m_pModDoc->SetModified(); EndWaitCursor(); SwitchToView(); @@ -1282,7 +1283,7 @@ SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate); } // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); m_pModDoc->SetModified(); } EndWaitCursor(); @@ -1407,7 +1408,7 @@ SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate); } // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); m_pModDoc->SetModified(); } EndWaitCursor(); @@ -1566,7 +1567,7 @@ } // Update sample view - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); // !!!! see CODE#0006, update#3 + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); // !!!! see CODE#0006, update#3 m_pModDoc->SetModified(); } @@ -1643,7 +1644,7 @@ OnPitchShiftTimeStretchAccept(); // Update sample view - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); // !!!! see CODE#0006, update#3 + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); // !!!! see CODE#0006, update#3 m_pModDoc->SetModified(); } @@ -2068,7 +2069,7 @@ } m_pModDoc->AdjustEndOfSample(m_nSample); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, NULL); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL); m_pModDoc->SetModified(); } EndWaitCursor(); @@ -2125,7 +2126,7 @@ } m_pModDoc->AdjustEndOfSample(m_nSample); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, NULL); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, NULL); m_pModDoc->SetModified(); } EndWaitCursor(); @@ -2173,7 +2174,7 @@ { memcpy(m_pSndFile->m_szNames[m_nSample], s, 32); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | (HINT_SMPNAMES|HINT_SAMPLEINFO), this); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | (HINT_SMPNAMES|HINT_SAMPLEINFO), this); m_pModDoc->UpdateAllViews(NULL, HINT_INSNAMES, this); m_pModDoc->SetModified(); } @@ -2194,7 +2195,7 @@ { memcpy(m_pSndFile->Ins[m_nSample].name, s, 22); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEINFO, this); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEINFO, this); if (m_pSndFile->m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) m_pModDoc->SetModified(); } } @@ -2430,7 +2431,7 @@ pins->nLoopStart = n; m_pModDoc->AdjustEndOfSample(m_nSample); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, this); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); m_pModDoc->SetModified(); } } @@ -2447,7 +2448,7 @@ pins->nLoopEnd = n; m_pModDoc->AdjustEndOfSample(m_nSample); // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, this); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); m_pModDoc->SetModified(); } } @@ -2487,7 +2488,7 @@ { pins->nSustainStart = n; // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, this); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); m_pModDoc->SetModified(); } } @@ -2504,7 +2505,7 @@ { pins->nSustainEnd = n; // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, this); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); m_pModDoc->SetModified(); } } @@ -2783,7 +2784,7 @@ if ((nCode == SB_ENDSCROLL) || (nCode == SB_THUMBPOSITION)) SwitchToView(); if (bRedraw) { // 05/01/05 : ericus replaced "m_nSample << 24" by "m_nSample << 20" : 4000 samples -> 12bits [see Moddoc.h] - m_pModDoc->UpdateAllViews(NULL, (m_nSample << 20) | HINT_SAMPLEDATA, this); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA, this); m_pModDoc->SetModified(); } UnlockControls(); Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -183,7 +183,10 @@ { InvalidateChannelsHeaders(); } - if (((dwHintMask & 0xFFFFFF) == HINT_PATTERNDATA) & (m_nPattern != (dwHintMask >> 24))) return; + //if (((dwHintMask & 0xFFFFFF) == HINT_PATTERNDATA) & (m_nPattern != (dwHintMask >> HINT_SHIFT_PAT))) return; + if ( (HintFlagPart(dwHintMask) == HINT_PATTERNDATA) && (m_nPattern != (dwHintMask >> HINT_SHIFT_PAT)) ) + return; + if (dwHintMask & (HINT_MODTYPE|HINT_PATTERNDATA)) { InvalidatePattern(FALSE); @@ -193,7 +196,7 @@ // -> CODE#0008 // -> DESC"#define to set pattern max size (number of rows) limit (now set to 1024 instead of 256)" // InvalidateRow(dwHintMask >> 24); - InvalidateRow(dwHintMask >> 22); + InvalidateRow(dwHintMask >> HINT_SHIFT_ROW); // -! BEHAVIOUR_CHANGE#0008 } @@ -313,11 +316,11 @@ { m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc); } else - if (note == 0xFE) + if (note == NOTE_NOTECUT) { m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 13*COLUMN_HEIGHT); } else - if (note >= 0xFF) + if (note >= NOTE_KEYOFF) { m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 14*COLUMN_HEIGHT); } else @@ -335,8 +338,11 @@ UINT o = (note-1) / 12; //Octave UINT n = (note-1) % 12; //Note m_Dib.TextBlt(x, y, pfnt->nNoteWidth, COLUMN_HEIGHT, xsrc, ysrc+(n+1)*COLUMN_HEIGHT); - m_Dib.TextBlt(x+pfnt->nNoteWidth, y, pfnt->nOctaveWidth, COLUMN_HEIGHT, - pfnt->nNumX, pfnt->nNumY+o*COLUMN_HEIGHT); + if(o <= 9) + m_Dib.TextBlt(x+pfnt->nNoteWidth, y, pfnt->nOctaveWidth, COLUMN_HEIGHT, + pfnt->nNumX, pfnt->nNumY+o*COLUMN_HEIGHT); + else + DrawLetter(x+pfnt->nNoteWidth, y, '?', pfnt->nOctaveWidth); } } } @@ -409,8 +415,8 @@ yofs = GetYScrollPos(); pSndFile = pModDoc->GetSoundFile(); nColumnWidth = m_szCell.cx; - nrows = pSndFile->PatternSize[m_nPattern]; - ncols = pSndFile->m_nChannels; + nrows = (pSndFile->Patterns[m_nPattern]) ? pSndFile->PatternSize[m_nPattern] : 0; + ncols = pSndFile->GetNumChannels(); xpaint = m_szHeader.cx; ypaint = rcClient.top; ncolhdr = xofs; @@ -783,7 +789,7 @@ { tx_col = row_col; bk_col = row_bkcol; - if ((CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->note) && (m->note <= 120)) + if ((CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->note) && (m->note <= NOTE_MAX)) { tx_col = MODCOLOR_NOTE; } @@ -1393,7 +1399,7 @@ INSTRUMENTHEADER *penv = pSndFile->Headers[m->instr]; memcpy(sztmp, penv->name, 32); sztmp[32] = 0; - if ((m->note) && (m->note <= 120)) + if ((m->note) && (m->note <= NOTE_MAX)) { UINT nsmp = penv->Keyboard[m->note-1]; if ((nsmp) && (nsmp <= pSndFile->m_nSamples)) Modified: trunk/OpenMPT/mptrack/EffectVis.cpp =================================================================== --- trunk/OpenMPT/mptrack/EffectVis.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/EffectVis.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -617,7 +617,7 @@ MakeChange(m_nDragItem, paramValue); m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_PATTERNDATA | (m_nPattern << 24), NULL); + m_pModDoc->UpdateAllViews(NULL, HINT_PATTERNDATA | (m_nPattern << HINT_SHIFT_PAT), NULL); } else if ((m_dwStatus & FXVSTATUS_LDRAGGING)) { @@ -652,7 +652,7 @@ m_nLastDrawnRow = row; m_pModDoc->SetModified(); - m_pModDoc->UpdateAllViews(NULL, HINT_PATTERNDATA | (m_nPattern << 24), NULL); + m_pModDoc->UpdateAllViews(NULL, HINT_PATTERNDATA | (m_nPattern << HINT_SHIFT_PAT), NULL); } //update status bar Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -372,14 +372,13 @@ BOOL CModDoc::OnSaveDocument(LPCTSTR lpszPathName) //------------------------------------------------ { - static int greccount = 0; - CHAR fext[_MAX_EXT]=""; + TCHAR fext[_MAX_EXT]=""; UINT nType = m_SndFile.m_nType, dwPacking = 0; BOOL bOk = FALSE; m_SndFile.m_dwLastSavedWithVersion = CMainFrame::GetFullVersionNumeric(); if (!lpszPathName) return FALSE; - _splitpath(lpszPathName, NULL, NULL, NULL, fext); + _tsplitpath(lpszPathName, NULL, NULL, NULL, fext); if (!lstrcmpi(fext, ".mod")) nType = MOD_TYPE_MOD; else if (!lstrcmpi(fext, ".s3m")) nType = MOD_TYPE_S3M; else if (!lstrcmpi(fext, ".xm")) nType = MOD_TYPE_XM; else @@ -421,6 +420,7 @@ // -> CODE#0023 // -> DESC="IT project files (.itp)" BOOL CModDoc::SaveModified() +//-------------------------- { if((m_SndFile.m_nType & MOD_TYPE_IT) && m_SndFile.m_dwSongFlags & SONG_ITPROJECT && !(m_SndFile.m_dwSongFlags & SONG_ITPEMBEDIH)){ @@ -435,8 +435,8 @@ for(UINT i = 0 ; i < m_SndFile.m_nInstruments ; i++){ if(m_SndFile.m_szInstrumentPath[i][0] != '\0'){ int size = strlen(m_SndFile.m_szInstrumentPath[i]); - BOOL iti = stricmp(&m_SndFile.m_szInstrumentPath[i][size-3],"iti") == 0; - BOOL xi = stricmp(&m_SndFile.m_szInstrumentPath[i][size-2],"xi") == 0; + BOOL iti = _stricmp(&m_SndFile.m_szInstrumentPath[i][size-3],"iti") == 0; + BOOL xi = _stricmp(&m_SndFile.m_szInstrumentPath[i][size-2],"xi") == 0; if(iti || (!iti && !xi && m_SndFile.m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) m_SndFile.SaveITIInstrument(i+1, m_SndFile.m_szInstrumentPath[i]); @@ -1247,7 +1247,7 @@ penv = m_SndFile.Headers[nIns]; if (penv) { - for (UINT i=0; i<120; i++) + for (UINT i=0; i<NOTE_MAX; i++) { if (penv->Keyboard[i] == nSmp) return TRUE; } @@ -1265,7 +1265,7 @@ INSTRUMENTHEADER *penv = m_SndFile.Headers[i]; if (penv) { - for (UINT j=0; j<120; j++) + for (UINT j=0; j<NOTE_MAX; j++) { if (penv->Keyboard[j] == nSmp) return i; } @@ -1283,7 +1283,7 @@ penv = m_SndFile.Headers[nIns]; if (penv) { - for (UINT i=0; i<120; i++) + for (UINT i=0; i<NOTE_MAX; i++) { UINT n = penv->Keyboard[i]; if ((n) && (n <= m_SndFile.m_nSamples)) return n; Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Moddoc.h 2008-06-07 12:17:24 UTC (rev 212) @@ -10,11 +10,8 @@ #endif // _MSC_VER >= 1000 #include "sndfile.h" +#include "misc_util.h" -// C-5 -#define NOTE_MIDDLEC (5*12+1) -#define NOTE_KEYOFF 0xFF -#define NOTE_NOTECUT 0xFE //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -39,6 +36,19 @@ #define HINT_UNDO 0x10000 #define HINT_MIXPLUGINS 0x20000 #define HINT_SPEEDCHANGE 0x40000 //rewbs.envRowGrid +#define HINT_MAXHINTFLAG HINT_SPEEDCHANGE +//Bits 0-18 are reserved. +#define HINT_MASK_FLAGS (2*HINT_MAXHINTFLAG - 1) //When applied to hint parameter, should give the flag part. +#define HINT_MASK_ITEM (~HINT_MASK_FLAGS) //To nullify update hintbits from hint parameter. +#define HintFlagPart(x) ((x) & HINT_MASK_FLAGS) + +//If fails, hint flagbits|itembits does not enable all bits; +//might be worthwhile to check the reason. +STATIC_ASSERT( (HINT_MASK_ITEM | HINT_MASK_FLAGS) == -1 ); + +//If fails, hint param flag and item parts overlap; might be a problem. +STATIC_ASSERT( (HINT_MASK_ITEM & HINT_MASK_FLAGS) == 0 ); + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // NOTE : be carefull when adding new flags !!! // ------------------------------------------------------------------------------------------------------------------------- @@ -50,6 +60,32 @@ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +//Updateview hints can, in addition to the actual hints, contain +//addition data such as pattern or instrument index. The +//values below define the number of bits used for these. +#define HINT_BITS_PATTERN 12 +#define HINT_BITS_ROWS 10 +#define HINT_BITS_SAMPLE 12 +#define HINT_BITS_INST 8 +#define HINT_BITS_CHNTAB 8 + +//Defines bit shift values used for setting/retrieving the additional hint data to/from hint parameter. +#define HINT_SHIFT_PAT (32 - HINT_BITS_PATTERN) +#define HINT_SHIFT_ROW (32 - HINT_BITS_ROWS) +#define HINT_SHIFT_SMP (32 - HINT_BITS_SAMPLE) +#define HINT_SHIFT_INS (32 - HINT_BITS_INST) +#define HINT_SHIFT_CHNTAB (32 - HINT_BITS_CHNTAB) + +//Check that hint bit counts are not too large given the number of hint flags. +STATIC_ASSERT( ((-1 << HINT_SHIFT_PAT) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_PAT) ); +STATIC_ASSERT( ((-1 << HINT_SHIFT_ROW) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_ROW) ); +STATIC_ASSERT( ((-1 << HINT_SHIFT_SMP) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_SMP) ); +STATIC_ASSERT( ((-1 << HINT_SHIFT_INS) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_INS) ); +STATIC_ASSERT( ((-1 << HINT_SHIFT_CHNTAB) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_CHNTAB) ); + + + // Undo #define MAX_UNDO_LEVEL 100 Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -8,15 +8,18 @@ #include "dlg_misc.h" #include "dlsbank.h" -#pragma warning(disable:4244) +#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data" + #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif +#define str_mptm_conversion_warning GetStrI18N(_TEXT("Conversion from mptm to any other moduletype may makes certain features unavailable and is not guaranteed to work properly. Do the conversion anyway?")) + ////////////////////////////////////////////////////////////////////// // Module type conversion @@ -52,9 +55,36 @@ if(oldTypeIsMPT) { - if(::MessageBox(NULL, "Convertion from MPTm to any other modtype makes certain features unavailable and is not guaranteed to work properly; Do the convertion anyway?", - "Notice", MB_YESNO) != IDYES) + if(::MessageBox(NULL, str_mptm_conversion_warning, 0, MB_YESNO) != IDYES) return FALSE; + + /* + Incomplete list of MPTm-only features and extensions in the old formats: + + Features only available for MPTm: + -User definable tunings. + -Extended pattern range + -Extended sequence + + Extended features in IT/XM/S3M/MOD(not all listed below are available in all of those formats): + -plugs + -Extended ranges for + -sample count + -instrument count + -pattern count + -sequence size + -Row count + -channel count + -tempo limits + -Extended sample/instrument properties. + -MIDI mapping directives + -Versioninfo + -channel names + -pattern names + -Alternative tempomodes + -For more info, see e.g. SaveExtendedSongProperties(), SaveExtendedInstrumentProperties() + */ + } // Check if conversion to 64 rows is necessary @@ -270,7 +300,7 @@ INSTRUMENTHEADER *penv = m_SndFile.Headers[j]; if (penv) { - for (UINT k=0; k<120; k++) + for (UINT k=0; k<NOTE_MAX; k++) { if ((penv->NoteMap[k]) && (penv->NoteMap[k] != (BYTE)(k+1))) { @@ -665,7 +695,7 @@ UINT jmax = m_SndFile.PatternSize[ipat] * m_SndFile.m_nChannels; for (UINT j=0; j<jmax; j++, p++) { - if ((p->note) && (p->note <= 120)) + if ((p->note) && (p->note <= NOTE_MAX)) { if ((p->instr) && (p->instr < MAX_INSTRUMENTS)) { @@ -1460,8 +1490,8 @@ switch(note) { case 0: p[1] = p[2] = p[3] = '.'; break; - case 0xFF: p[1] = p[2] = p[3] = '='; break; - case 0xFE: p[1] = p[2] = p[3] = '^'; break; + case NOTE_KEYOFF: p[1] = p[2] = p[3] = '='; break; + case NOTE_NOTECUT: p[1] = p[2] = p[3] = '^'; break; default: p[1] = szNoteNames[(note-1) % 12][0]; p[2] = szNoteNames[(note-1) % 12][1]; @@ -1604,8 +1634,8 @@ (ITStyleMix && origModCmd.note==0 && origModCmd.instr==0 && origModCmd.volcmd==0)))) { m[col].note = 0; - if (s[0] == '=') m[col].note = 0xFF; else - if (s[0] == '^') m[col].note = 0xFE; else + if (s[0] == '=') m[col].note = NOTE_KEYOFF; else + if (s[0] == '^') m[col].note = NOTE_NOTECUT; else if (s[0] != '.') { for (UINT i=0; i<12; i++) @@ -1710,7 +1740,7 @@ if (bOk) { SetModified(); - UpdateAllViews(NULL, HINT_PATTERNDATA | (nPattern << 24), NULL); + UpdateAllViews(NULL, HINT_PATTERNDATA | (nPattern << HINT_SHIFT_PAT), NULL); } } CloseClipboard(); @@ -1831,7 +1861,7 @@ INSTRUMENTHEADER *penv = m_SndFile.Headers[nIns]; UINT susBegin=0, susEnd=0, loopBegin=0, loopEnd=0, bSus=0, bLoop=0, bCarry=0, nPoints=0, releaseNode = ENV_RELEASE_NODE_UNSET; DWORD dwMemSize = GlobalSize(hCpy), dwPos = strlen(pszEnvHdr); - if ((dwMemSize > dwPos) && (!strnicmp(p, pszEnvHdr, dwPos-2))) + if ((dwMemSize > dwPos) && (!_strnicmp(p, pszEnvHdr, dwPos-2))) { for (UINT h=0; h<8; h++) { @@ -1947,7 +1977,7 @@ GlobalUnlock(hCpy); CloseClipboard(); SetModified(); - UpdateAllViews(NULL, (nIns << 24) | HINT_ENVELOPE, NULL); + UpdateAllViews(NULL, (nIns << HINT_SHIFT_INS) | HINT_ENVELOPE, NULL); } EndWaitCursor(); return TRUE; Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -7,9 +7,12 @@ #include "moptions.h" #include "moddoc.h" #include "snddev.h" +#include ".\mpdlgs.h" -#pragma warning(disable:4244) +#define str_preampChangeNote GetStrI18N(_TEXT("Note: Pre-Amp setting affects sample volume only. Changing this setting may cause undesired effects on volume balance between sample based instruments and plugin instrument.")) +//#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data" + LPCSTR szCPUNames[8] = { "133MHz", @@ -165,11 +168,9 @@ } // Pre-Amplification { - int n = (CMainFrame::m_nPreAmp - 64) / 8; - if ((n < 0) || (n > 40)) n = 16; m_SliderPreAmp.SetTicFreq(5); m_SliderPreAmp.SetRange(0, 40); - m_SliderPreAmp.SetPos(40 - n); + SetPreAmpSliderPosition(); } // Sound Device { @@ -255,18 +256,36 @@ } +void COptionsSoundcard::SetPreAmpSliderPosition() +//----------------------------------------------- +{ + int n = (CMainFrame::m_nPreAmp - 64) / 8; + if ((n < 0) || (n > 40)) n = 16; + m_SliderPreAmp.SetPos(40 - n); +} + + void COptionsSoundcard::OnVScroll(UINT n, UINT pos, CScrollBar *p) //---------------------------------------------------------------- { CPropertyPage::OnVScroll(n, pos, p); // PreAmp { - int n = 40 - m_SliderPreAmp.GetPos(); - if ((n >= 0) && (n <= 40)) // approximately +/- 10dB + if(m_PreAmpNoteShowed == true) { - CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - if (pMainFrm) pMainFrm->SetPreAmp(64 + (n * 8)); + int n = 40 - m_SliderPreAmp.GetPos(); + if ((n >= 0) && (n <= 40)) // approximately +/- 10dB + { + CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); + if (pMainFrm) pMainFrm->SetPreAmp(64 + (n * 8)); + } } + else + { + m_PreAmpNoteShowed = true; + MessageBox(str_preampChangeNote, _TEXT(""), MB_ICONINFORMATION); + SetPreAmpSliderPosition(); + } } } @@ -464,7 +483,7 @@ //rewbs.resamplerConf OnResamplerChanged(); char s[20] = ""; - ltoa(CMainFrame::glVolumeRampSamples,s, 10); + _ltoa(CMainFrame::glVolumeRampSamples,s, 10); m_CEditRamping.SetWindowText(s); //end rewbs.resamplerConf return TRUE; @@ -499,7 +518,7 @@ //rewbs.resamplerConf void COptionsPlayer::OnWFIRTypeChanged() { - CMainFrame::gbWFIRType = m_CbnWFIRType.GetCurSel(); + CMainFrame::gbWFIRType = static_cast<BYTE>(m_CbnWFIRType.GetCurSel()); OnSettingsChanged(); } @@ -1150,5 +1169,3 @@ return CPropertyPage::OnSetActive(); } - - Modified: trunk/OpenMPT/mptrack/Mpdlgs.h =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.h 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Mpdlgs.h 2008-06-07 12:17:24 UTC (rev 212) @@ -17,11 +17,16 @@ DWORD m_dwRate, m_dwSoundSetup, m_nBitsPerSample, m_nChannels; DWORD m_nBufferLength; DWORD m_nSoundDevice; + bool m_PreAmpNoteShowed; public: COptionsSoundcard(DWORD rate, DWORD q, DWORD bits, DWORD chns, DWORD bufsize, DWORD sd):CPropertyPage(IDD_OPTIONS_SOUNDCARD) - { m_dwRate = rate; m_dwSoundSetup = q; m_nBitsPerSample = bits; m_nChannels = chns; m_nBufferLength = bufsize; m_nSoundDevice = sd; } + { m_dwRate = rate; m_dwSoundSetup = q; m_nBitsPerSample = bits; m_nChannels = chns; + m_nBufferLength = bufsize; m_nSoundDevice = sd; m_PreAmpNoteShowed = false;} +private: + void SetPreAmpSliderPosition(); + protected: virtual BOOL OnInitDialog(); virtual void OnOK(); Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -632,11 +632,13 @@ // Initialize OLE MFC support AfxOleInit(); // Standard initialization +/* #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif +*/ // Change the registry key under which our settings are stored. //SetRegistryKey(_T("Olivier Lapicque")); Modified: trunk/OpenMPT/mptrack/Stdafx.h =================================================================== --- trunk/OpenMPT/mptrack/Stdafx.h 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/Stdafx.h 2008-06-07 12:17:24 UTC (rev 212) @@ -78,6 +78,9 @@ #define VERSIONNUMBER(v1, v2, v3, v4) ((v1 << 24) + (v2 << 16) + (v3 << 8) + v4) +//To mark string that should be translated in case of multilingual version. +#define GetStrI18N(x) (x) + //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2008-05-10 13:27:55 UTC (rev 211) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2008-06-07 12:17:24 UTC (rev 212) @@ -283,7 +283,7 @@ void CViewGlobals::OnUpdate(CView* pView, LPARAM lHint, CObject*pHint) //-------------------------------------------------------------------- { - if (((lHint & 0xFFFF) == HINT_MODCHANNELS) && ((lHint >> 24) != m_nActiveTab)) return; + if ((HintFlagPart(lHint) == HINT_MODCHANNELS) && ((lHint >> HINT_SHIFT_CHNTAB) != m_nActiveTab)) return; if (pView != this) UpdateView(lHint, pHint); } @@ -329,7 +329,6 @@ } if (nOldSel >= (UINT)nTabCount) nOldSel = 0; - //Changing the order of these calls seemed to fix a GUI bug (http://lpchip.com/modplug/viewtopic.php?t=1324) m_TabCtrl.SetRedraw(TRUE); m_TabCtrl.SetCurSel(nOldSel); @@ -560,263 +559,90 @@ if (pResult) *pResult = 0; } - -void CViewGlobals::OnMute1() -//-------------------------- +void CViewGlobals::OnMute(const CHANNELINDEX chnMod4, const UINT itemID) +//--------------------------------------------------------- { CModDoc *pModDoc = GetDocument(); - BOOL b = (IsDlgButtonChecked(IDC_CHECK1)) ? TRUE : FALSE; - UINT nChn = m_nActiveTab * 4; if (pModDoc) { + const BOOL b = (IsDlgButtonChecked(itemID)) ? TRUE : FALSE; + const UINT nChn = m_nActiveTab * 4 + chnMod4; pModDoc->MuteChannel(nChn, b); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); + pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB)); } } +void CViewGlobals::OnMute1() {OnMute(0, IDC_CHECK1);} +void CViewGlobals::OnMute2() {OnMute(1, IDC_CHECK3);} +void CViewGlobals::OnMute3() {OnMute(2, IDC_CHECK5);} +void CViewGlobals::OnMute4() {OnMute(3, IDC_CHECK7);} -void CViewGlobals::OnMute2() -//-------------------------- -{ - CModDoc *pModDoc = GetDocument(); - BOOL b = (IsDlgButtonChecked(IDC_CHECK3)) ? TRUE : FALSE; - UINT nChn = m_nActiveTab * 4 + 1; - - if (pModDoc) - { - pModDoc->MuteChannel(nChn, b); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } -} - -void CViewGlobals::OnMute3() -//-------------------------- +void CViewGlobals::OnSurround(const CHANNELINDEX chnMod4, const UINT itemID) +//-------------------------------------------------------------- { CModDoc *pModDoc = GetDocument(); - BOOL b = (IsDlgButtonChecked(IDC_CHECK5)) ? TRUE : FALSE; - UINT nChn = m_nActiveTab * 4 + 2; if (pModDoc) { - pModDoc->MuteChannel(nChn, b); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } -} - - -void CViewGlobals::OnMute4() -//-------------------------- -{ - CModDoc *pModDoc = GetDocument(); - BOOL b = (IsDlgButtonChecked(IDC_CHECK7)) ? TRUE : FALSE; - UINT nChn = m_nActiveTab * 4 + 3; - - if (pModDoc) - { - pModDoc->MuteChannel(nChn, b); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } -} - - -void CViewGlobals::OnSurround1() -//------------------------------ -{ - CModDoc *pModDoc = GetDocument(); - BOOL b = (IsDlgButtonChecked(IDC_CHECK2)) ? TRUE : FALSE; - UINT nChn = m_nActiveTab * 4; - - if (pModDoc) - { + const BOOL b = (IsDlgButtonChecked(itemID)) ? TRUE : FALSE; + const UINT nChn = m_nActiveTab * 4 + chnMod4; pModDoc->SurroundChannel(nChn, b); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); + pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB)); } } +void CViewGlobals::OnSurround1() {OnSurround(0, IDC_CHECK2);} +void CViewGlobals::OnSurround2() {OnSurround(1, IDC_CHECK4);} +void CViewGlobals::OnSurround3() {OnSurround(2, IDC_CHECK6);} +void CViewGlobals::OnSurround4() {OnSurround(3, IDC_CHECK8);} -void CViewGlobals::OnSurround2() -//------------------------------ +void CViewGlobals::OnEditVol(const CHANNELINDEX chnMod4, const UINT itemID) +//------------------------------------------------------------ { CModDoc *pModDoc = GetDocument(); - BOOL b = (IsDlgButtonChecked(IDC_CHECK4)) ? TRUE : FALSE; - UINT nChn = m_nActiveTab * 4 + 1; - - if (pModDoc) - { - pModDoc->SurroundChannel(nChn, b); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } -} - - -void CViewGlobals::OnSurround3() -//------------------------------ -{ - CModDoc *pModDoc = GetDocument(); - BOOL b = (IsDlgButtonChecked(IDC_CHECK6)) ? TRUE : FALSE; - UINT nChn = m_nActiveTab * 4 + 2; - - if (pModDoc) - { - pModDoc->SurroundChannel(nChn, b); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } -} - - -void CViewGlobals::OnSurround4() -//------------------------------ -{ - CModDoc *pModDoc = GetDocument(); - BOOL b = (IsDlgButtonChecked(IDC_CHECK8)) ? TRUE : FALSE; - UINT nChn = m_nActiveTab * 4 + 3; - - if (pModDoc) - { - pModDoc->SurroundChannel(nChn, b); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } -} - - -void CViewGlobals::OnEditVol1() -//----------------------------- -{ - CModDoc *pModDoc = GetDocument(); - UINT nChn = m_nActiveTab * 4; - int vol = GetDlgItemIntEx(IDC_EDIT1); + const UINT nChn = m_nActiveTab * 4 + chnMod4; + const int vol = GetDlgItemIntEx(itemID); if ((pModDoc) && (vol >= 0) && (vol <= 64) && (!m_nLockCount)) { if (pModDoc->SetChannelGlobalVolume(nChn, vol)) { - m_sbVolume[0].SetPos(vol); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); + m_sbVolume[chnMod4].SetPos(vol); + pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB)); } } } +void CViewGlobals::OnEditVol1() {OnEditVol(0, IDC_EDIT1);} +void CViewGlobals::OnEditVol2() {OnEditVol(1, IDC_EDIT3);} +void CViewGlobals::OnEditVol3() {OnEditVol(2, IDC_EDIT5);} +void CViewGlobals::OnEditVol4() {OnEditVol(3, IDC_EDIT7);} -void CViewGlobals::OnEditVol2() -//----------------------------- -{ - CModDoc *pModDoc = GetDocument(); - UINT nChn = m_nActiveTab * 4 + 1; - int vol = GetDlgItemIntEx(IDC_EDIT3); - if ((pModDoc) && (vol >= 0) && (vol <= 64) && (!m_nLockCount)) - { - if (pModDoc->SetChannelGlobalVolume(nChn, vol)) - { - m_sbVolume[1].SetPos(vol); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } - } -} - -void CViewGlobals::OnEditVol3() -//----------------------------- +void CViewGlobals::OnEditPan(const CHANNELINDEX chnMod4, const UINT itemID) +//-------------------------------------------------------- { CModDoc *pModDoc = GetDocument(); - UINT nChn = m_nActiveTab * 4 + 2; - int vol = GetDlgItemIntEx(IDC_EDIT5); - if ((pModDoc) && (vol >= 0) && (vol <= 64) && (!m_nLockCount)) - { - if (pModDoc->SetChannelGlobalVolume(nChn, vol)) - { - m_sbVolume[2].SetPos(vol); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } - } -} - - -void CViewGlobals::OnEditVol4() -//----------------------------- -{ - CModDoc *pModDoc = GetDocument(); - UINT nChn = m_nActiveTab * 4 + 3; - int vol = GetDlgItemIntEx(IDC_EDIT7); - if ((pModDoc) && (vol >= 0) && (vol <= 64) && (!m_nLockCount)) - { - if (pModDoc->SetChannelGlobalVolume(nChn, vol)) - { - m_sbVolume[3].SetPos(vol); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } - } -} - - -void CViewGlobals::OnEditPan1() -//----------------------------- -{ - CModDoc *pModDoc = GetDocument(); - UINT nChn = m_nActiveTab * 4; - int pan = GetDlgItemIntEx(IDC_EDIT2); + const UINT nChn = m_nActiveTab * 4 + chnMod4; + const int pan = GetDlgItemIntEx(itemID); if ((pModDoc) && (pan >= 0) && (pan <= 256) && (!m_nLockCount)) { if (pModDoc->SetChannelDefaultPan(nChn, pan)) { - m_sbPan[0].SetPos(pan/4); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); + m_sbPan[chnMod4].SetPos(pan/4); + pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB)); } } } -void CViewGlobals::OnEditPan2() -//----------------------------- -{ - CModDoc *pModDoc = GetDocument(); - UINT nChn = m_nActiveTab * 4 + 1; - int pan = GetDlgItemIntEx(IDC_EDIT4); - if ((pModDoc) && (pan >= 0) && (pan <= 256) && (!m_nLockCount)) - { - if (pModDoc->SetChannelDefaultPan(nChn, pan)) - { - m_sbPan[1].SetPos(pan/4); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } - } -} +void CViewGlobals::OnEditPan1() {OnEditPan(0, IDC_EDIT2);} +void CViewGlobals::OnEditPan2() {OnEditPan(1, IDC_EDIT4);} +void CViewGlobals::OnEditPan3() {OnEditPan(2, IDC_EDIT6);} +void CViewGlobals::OnEditPan4() {OnEditPan(3, IDC_EDIT8);} -void CViewGlobals::OnEditPan3() -//----------------------------- -{ - CModDoc *pModDoc = GetDocument(); - UINT nChn = m_nActiveTab * 4 + 2; - int pan = GetDlgItemIntEx(IDC_EDIT6); - if ((pModDoc) && (pan >= 0) && (pan <= 256) && (!m_nLockCount)) - { - if (pModDoc->SetChannelDefaultPan(nChn, pan)) - { - m_sbPan[2].SetPos(pan/4); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } - } -} - - -void CViewGlobals::OnEditPan4() -//----------------------------- -{ - CModDoc *pModDoc = GetDocument(); - UINT nChn = m_nActiveTab * 4 + 3; - int pan = GetDlgItemIntEx(IDC_EDIT8); - if ((pModDoc) && (pan >= 0) && (pan <= 256) && (!m_nLockCount)) - { - if (pModDoc->SetChannelDefaultPan(nChn, pan)) - { - m_sbPan[3].SetPos(pan/4); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } - } -} - - void CViewGlobals::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) //--------------------------------------------------------------------------- { @@ -880,7 +706,7 @@ } //end rewbs.dryRatio - if (bUpdate) pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); + if (bUpdate) pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB)); UnlockControls(); if ((pScrollBar) && (pScrollBar->m_hWnd == m_sbValue.m_hWnd)) @@ -952,8 +778,8 @@ } -void CViewGlobals::OnEditName1() -//------------------------------ +void CViewGlobals::OnEditName(const CHANNELINDEX chnMod4, const UINT itemID) +//---------------------------------------------------------------------- { CModDoc *pModDoc = GetDocument(); @@ -961,181 +787,53 @@ { CSoundFile *pSndFile = pModDoc->GetSoundFile(); CHAR s[MAX_CHANNELNAME+4]; - UINT nChn = m_nActiveTab * 4; + const UINT nChn = m_nActiveTab * 4 + chnMod4; memset(s, 0, sizeof(s)); - GetDlgItemText(IDC_EDIT9, s, sizeof(s)); + GetDlgItemText(itemID, s, sizeof(s)); s[MAX_CHANNELNAME+1] = 0; if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME))) { memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME); pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFile->ChnSettings[nChn].szName)-1] = 0; pModDoc->SetModified(); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); + pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << HINT_SHIFT_CHNTAB)); } } } +void CViewGlobals::OnEditName1() {OnEditName(0, IDC_EDIT9);} +void CViewGlobals::OnEditName2() {OnEditName(1, IDC_EDIT10);} +void CViewGlobals::OnEditName3() {OnEditName(2, IDC_EDIT11);} +void CViewGlobals::OnEditName4() {OnEditName(3, IDC_EDIT12);} -void CViewGlobals::OnEditName2() -//------------------------------ +void CViewGlobals::OnFxChanged(const CHANNELINDEX chnMod4) +//-------------------------------------------------------- { CModDoc *pModDoc = GetDocument(); - if ((pModDoc) && (!m_nLockCount)) - { - CSoundFile *pSndFile = pModDoc->GetSoundFile(); - CHAR s[MAX_CHANNELNAME+4]; - UINT nChn = m_nActiveTab * 4 + 1; - - memset(s, 0, sizeof(s)); - GetDlgItemText(IDC_EDIT10, s, sizeof(s)); - s[MAX_CHANNELNAME+1] = 0; - if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME))) - { - memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME); - pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFile->ChnSettings[nChn].szName)-1] = 0; - pModDoc->SetModified(); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } - } -} - - -void CViewGlobals::OnEditName3() -//------------------------------ -{ - CModDoc *pModDoc = GetDocument(); - - if ((pModDoc) && (!m_nLockCount)) - { - CSoundFile *pSndFile = pModDoc->GetSoundFile(); - CHAR s[MAX_CHANNELNAME+4]; - UINT nChn = m_nActiveTab * 4 + 2; - - memset(s, 0, sizeof(s)); - GetDlgItemText(IDC_EDIT11, s, sizeof(s)); - s[MAX_CHANNELNAME+1] = 0; - if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME))) - { - memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME); - pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFile->ChnSettings[nChn].szName)-1] = 0; - pModDoc->SetModified(); - pModDoc->UpdateAllViews(this, HINT_MODCHANNELS | (m_nActiveTab << 24)); - } - } -} - - -void CViewGlobals::OnEditName4() -//------------------------------ -{ - CModDoc *pModDoc = GetDocument(); - - if ((pModDoc) && (!m_nLockCount)) - { - CSoundFile *pSndFile = pModDoc->GetSoundFile(); - CHAR s[MAX_CHANNELNAME+4]; - UINT nChn = m_nActiveTab * 4 + 3; - - memset(s, 0, sizeof(s)); - GetDlgItemText(IDC_EDIT12, s, sizeof(s)); - s[MAX_CHANNELNAME+1] = 0; - if ((pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) && (nChn < pSndFile->m_nChannels) && (strncmp(s, pSndFile->ChnSettings[nChn].szName, MAX_CHANNELNAME))) - { - memcpy(pSndFile->ChnSettings[nChn].szName, s, MAX_CHANNELNAME); - pSndFile->ChnSettings[nChn].szName[ARRAYELEMCOUNT(pSndFi... [truncated message content] |