From: <sag...@us...> - 2014-08-21 14:20:15
|
Revision: 4209 http://sourceforge.net/p/modplug/code/4209 Author: saga-games Date: 2014-08-21 14:20:01 +0000 (Thu, 21 Aug 2014) Log Message: ----------- [Mod] Merge "Note Off/Cut/Fade" and "Note Off/Cut/Fade (without instrument number)". It's a bad idea to attach instrument numbers to note-offs (especially in XM), and there's no real reason to do it anyway. [Mod] OpenMPT: Version is now 1.23.04.08 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-08-19 08:51:34 UTC (rev 4208) +++ trunk/OpenMPT/common/versionNumber.h 2014-08-21 14:20:01 UTC (rev 4209) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 23 #define VER_MINOR 04 -#define VER_MINORMINOR 07 +#define VER_MINORMINOR 08 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2014-08-19 08:51:34 UTC (rev 4208) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2014-08-21 14:20:01 UTC (rev 4209) @@ -65,8 +65,8 @@ //------------------------------------------------------- // Helper function for setting up commands -void CCommandSet::DefineKeyCommand(CommandID kc, UINT uid, CString message, enmKcVisibility visibility, enmKcDummy dummy) -//----------------------------------------------------------------------------------------------------------------------- +void CCommandSet::DefineKeyCommand(CommandID kc, UINT uid, const TCHAR *message, enmKcVisibility visibility, enmKcDummy dummy) +//---------------------------------------------------------------------------------------------------------------------------- { commands[kc].UID = uid; commands[kc].isHidden = (visibility == kcHidden); @@ -483,8 +483,8 @@ DefineKeyCommand(kcClearFieldITStyle, 1664, _T("Clear field (IT Style)")); DefineKeyCommand(kcClearFieldStepITStyle, 1665, _T("Clear field and step (IT Style)")); DefineKeyCommand(kcSetFXextension, 1666, _T("Parameter Extension Command")); - DefineKeyCommand(kcNoteCutOld, 1667, _T("Note Cut (without instrument number)")); - DefineKeyCommand(kcNoteOffOld, 1668, _T("Note Off (without instrument number)")); + DefineKeyCommand(kcNoteCutOld, 1667, _T("Note Cut"), kcHidden); // Legacy + DefineKeyCommand(kcNoteOffOld, 1668, _T("Note Off"), kcHidden); // Legacy DefineKeyCommand(kcViewAddPlugin, 1669, _T("View Plugin Manager")); DefineKeyCommand(kcViewChannelManager, 1670, _T("View Channel Manager")); DefineKeyCommand(kcCopyAndLoseSelection, 1671, _T("Copy and lose selection")); @@ -546,7 +546,7 @@ DefineKeyCommand(kcNotePCS, 1789, _T("Parameter control(smooth)(MPTm only)")); DefineKeyCommand(kcSampleRemoveDCOffset, 1790, _T("Remove DC Offset")); DefineKeyCommand(kcNoteFade, 1791, _T("Note Fade")); - DefineKeyCommand(kcNoteFadeOld, 1792, _T("Note Fade (without instrument number)")); + DefineKeyCommand(kcNoteFadeOld, 1792, _T("Note Fade"), kcHidden); // Legacy DefineKeyCommand(kcEditPasteFlood, 1793, _T("Paste Flood")); DefineKeyCommand(kcOrderlistNavigateLeft, 1794, _T("Previous Order")); DefineKeyCommand(kcOrderlistNavigateRight, 1795, _T("Next Order")); @@ -1343,6 +1343,16 @@ } } + + // Legacy: Note off commands with and without instrument numbers are now the same. + commands[kcNoteCut].kcList.insert(commands[kcNoteCut].kcList.end(), commands[kcNoteCutOld].kcList.begin(), commands[kcNoteCutOld].kcList.end()); + commands[kcNoteCutOld].kcList.clear(); + commands[kcNoteOff].kcList.insert(commands[kcNoteOff].kcList.end(), commands[kcNoteOffOld].kcList.begin(), commands[kcNoteOffOld].kcList.end()); + commands[kcNoteOffOld].kcList.clear(); + commands[kcNoteFade].kcList.insert(commands[kcNoteFade].kcList.end(), commands[kcNoteFadeOld].kcList.begin(), commands[kcNoteFadeOld].kcList.end()); + commands[kcNoteFadeOld].kcList.clear(); + + /* if (enforceRule[krFoldEffectColumnAnd]) { if (inKc.ctx == kCtxViewPatternsFX) { Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2014-08-19 08:51:34 UTC (rev 4208) +++ trunk/OpenMPT/mptrack/CommandSet.h 2014-08-21 14:20:01 UTC (rev 4209) @@ -1230,17 +1230,6 @@ UINT UID; bool isDummy; bool isHidden; - - bool operator= (const CommandStruct &other) - { - UID = other.UID; - Message = other.Message; - isDummy = other.isDummy; - isHidden = other.isHidden; - kcList = other.kcList; - return true; - } - }; @@ -1282,7 +1271,7 @@ { protected: //util - inline void DefineKeyCommand(CommandID kc, UINT uid, CString message, enmKcVisibility visible = kcVisible, enmKcDummy dummy = kcNoDummy); + inline void DefineKeyCommand(CommandID kc, UINT uid, const TCHAR *message, enmKcVisibility visible = kcVisible, enmKcDummy dummy = kcNoDummy); void SetupCommands(); void SetupContextHierarchy(); bool IsDummyCommand(CommandID cmd); Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2014-08-19 08:51:34 UTC (rev 4208) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2014-08-21 14:20:01 UTC (rev 4209) @@ -2186,9 +2186,7 @@ case kcNextInstrument: OnNextInstrument(); return wParam; case kcEditCopy: OnEditCopy(); return wParam; case kcEditPaste: OnEditPaste(); return wParam; - case kcNoteOffOld: case kcNoteOff: PlayNote(NOTE_KEYOFF); return wParam; - case kcNoteCutOld: case kcNoteCut: PlayNote(NOTE_NOTECUT); return wParam; case kcInstrumentLoad: SendCtrlMessage(IDC_INSTRUMENT_OPEN); return wParam; case kcInstrumentSave: SendCtrlMessage(IDC_INSTRUMENT_SAVEAS); return wParam; Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2014-08-19 08:51:34 UTC (rev 4208) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2014-08-21 14:20:01 UTC (rev 4209) @@ -3906,7 +3906,7 @@ nVol = CMainFrame::ApplyVolumeRelatedSettings(dwMidiData, midivolume); if(nVol < 0) nVol = -1; else nVol = (nVol + 3) / 4; //Value from [0,256] to [0,64] - TempEnterNote(nNote, true, nVol, true); + TempEnterNote(nNote, nVol, true); // continue playing as soon as MIDI notes are being received (http://forum.openmpt.org/index.php?topic=2813.0) if(sndFile.IsPaused() && (TrackerSettings::Instance().m_dwMidiSetup & MIDISETUP_PLAYPATTERNONMIDIIN)) @@ -4407,12 +4407,9 @@ return wParam; case kcPatternGoto: OnEditGoto(); return wParam; - case kcNoteCut: TempEnterNote(NOTE_NOTECUT, false); return wParam; - case kcNoteCutOld: TempEnterNote(NOTE_NOTECUT, true); return wParam; - case kcNoteOff: TempEnterNote(NOTE_KEYOFF, false); return wParam; - case kcNoteOffOld: TempEnterNote(NOTE_KEYOFF, true); return wParam; - case kcNoteFade: TempEnterNote(NOTE_FADE, false); return wParam; - case kcNoteFadeOld: TempEnterNote(NOTE_FADE, true); return wParam; + case kcNoteCut: TempEnterNote(NOTE_NOTECUT); return wParam; + case kcNoteOff: TempEnterNote(NOTE_KEYOFF); return wParam; + case kcNoteFade: TempEnterNote(NOTE_FADE); return wParam; case kcNotePC: TempEnterNote(NOTE_PC); return wParam; case kcNotePCS: TempEnterNote(NOTE_PCS); return wParam; @@ -5058,8 +5055,8 @@ // Enter a note in the pattern -void CViewPattern::TempEnterNote(int note, bool oldStyle, int vol, bool fromMidi) -//------------------------------------------------------------------------------- +void CViewPattern::TempEnterNote(int note, int vol, bool fromMidi) +//---------------------------------------------------------------- { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CModDoc *pModDoc = GetDocument(); @@ -5214,8 +5211,8 @@ } } - // -- old style note cut/off/fade: erase instrument number - if (oldStyle && newcmd.note >= NOTE_MIN_SPECIAL) + // Note cut/off/fade: erase instrument number + if(newcmd.note >= NOTE_MIN_SPECIAL) newcmd.instr = 0; } Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2014-08-19 08:51:34 UTC (rev 4208) +++ trunk/OpenMPT/mptrack/View_pat.h 2014-08-21 14:20:01 UTC (rev 4209) @@ -303,7 +303,7 @@ void CursorJump(DWORD distance, bool upwards, bool snap); - void TempEnterNote(int n, bool oldStyle = false, int vol = -1, bool fromMidi = false); + void TempEnterNote(int n, int vol = -1, bool fromMidi = false); void TempStopNote(int note, bool fromMidi = false, const bool bChordMode = false); void TempEnterChord(int n); void TempStopChord(int note) {TempStopNote(note, false, true);} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |