From: <sag...@us...> - 2014-05-23 01:08:35
|
Revision: 4057 http://sourceforge.net/p/modplug/code/4057 Author: saga-games Date: 2014-05-23 01:08:30 +0000 (Fri, 23 May 2014) Log Message: ----------- [Fix] VST: When trying to play a VST with no instrument assigned yet, prevent notes from being stuck after closing the instrument creation confirmation. [Fix] Tree view: It was not possible to drag&drop drums from sound banks (http://bugs.openmpt.org/view.php?id=536, x64 only) [Mod] OpenMPT: Version is now 1.23.03.02 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/View_tre.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-05-17 16:54:04 UTC (rev 4056) +++ trunk/OpenMPT/common/versionNumber.h 2014-05-23 01:08:30 UTC (rev 4057) @@ -17,7 +17,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 23 #define VER_MINOR 03 -#define VER_MINORMINOR 01 +#define VER_MINORMINOR 02 //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/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2014-05-17 16:54:04 UTC (rev 4056) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2014-05-23 01:08:30 UTC (rev 4057) @@ -355,7 +355,7 @@ KeyEventType kT = ih->GetKeyEventType(nFlags); // If we successfully mapped to a command and plug does not listen for keypresses, no need to pass message on. - if(ih->KeyEvent(kCtxVSTGUI, nChar, nRepCnt, nFlags, kT, (CWnd*)this) != kcNull) + if(ih->KeyEvent(kCtxVSTGUI, nChar, nRepCnt, nFlags, kT, this) != kcNull) { return true; } @@ -460,7 +460,10 @@ return false; } else { - return CreateInstrument(); + CreateInstrument(); + // Return true since we don't want to trigger the note for which the instrument has been validated yet. + // Otherwise, the note might hang forever because the key-up event will go missing. + return false; } } else { Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2014-05-17 16:54:04 UTC (rev 4056) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2014-05-23 01:08:30 UTC (rev 4057) @@ -1140,13 +1140,13 @@ hRootParent = GetParentRootItem(hItem); } - DWORD_PTR itemData = GetItemData(hItem); - DWORD_PTR rootItemData = GetItemData(hRootParent); + uint32 itemData = static_cast<uint32>(GetItemData(hItem)); + uint32 rootItemData = static_cast<uint32>(GetItemData(hRootParent)); // Midi Library if(hRootParent == m_hMidiLib && hRootParent != hItem && !IsSampleBrowser()) { - return ModItem(static_cast<ModItemType>(itemData >> MIDILIB_SHIFT), static_cast<uint32>(itemData & MIDILIB_MASK)); + return ModItem(static_cast<ModItemType>(itemData >> MIDILIB_SHIFT), itemData & MIDILIB_MASK); } // Instrument Library if(hRootParent == m_hInsLib || (IsSampleBrowser() && hItem != m_hInsLib)) @@ -1196,7 +1196,7 @@ } } - ModItem modItem(MODITEM_NULL, (uint32)itemData); + ModItem modItem(MODITEM_NULL, itemData); if (hItemParent == pInfo->hPatterns) { // Pattern @@ -1220,7 +1220,7 @@ // DLS banks if(itemData < m_tiDLS.size() && hItem == m_tiDLS[itemData]) - return ModItem(MODITEM_DLSBANK_FOLDER, (uint32)itemData); + return ModItem(MODITEM_DLSBANK_FOLDER, itemData); // DLS Instruments if(hRootParent != nullptr) @@ -1402,7 +1402,7 @@ case MODITEM_MIDIINSTRUMENT: { MIDILIBSTRUCT &midiLib = CTrackApp::GetMidiLibrary(); - if(modItemID < 256 && !midiLib.MidiMap[modItemID].empty()) + if(modItemID < CountOf(midiLib.MidiMap) && !midiLib.MidiMap[modItemID].empty()) { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); if (pMainFrm) pMainFrm->PlaySoundFile(midiLib.MidiMap[modItemID], static_cast<ModCommand::NOTE>(nParam)); @@ -1410,8 +1410,7 @@ } return TRUE; - default: - if (modItem.type == MODITEM_DLSBANK_INSTRUMENT) + case MODITEM_DLSBANK_INSTRUMENT: { const DlsItem &item = *static_cast<const DlsItem *>(&modItem); CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |