From: <sag...@us...> - 2012-04-02 18:17:07
|
Revision: 1241 http://modplug.svn.sourceforge.net/modplug/?rev=1241&view=rev Author: saga-games Date: 2012-04-02 18:17:00 +0000 (Mon, 02 Apr 2012) Log Message: ----------- [Mod] Instrument Editor: Made sample number cleaning also happen when switching pluginsm not only loading new ones. [Mod] OpenMPT: Version is now 1.20.00.83 Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/version.h Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2012-04-02 17:59:09 UTC (rev 1240) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2012-04-02 18:17:00 UTC (rev 1241) @@ -2169,42 +2169,42 @@ } UpdatePluginList(); - if(plugin.pMixPlugin != nullptr && plugin.pMixPlugin->isInstrument()) - { - // If we just added an instrument plugin, zap the sample assignments. - const std::set<SAMPLEINDEX> referencedSamples = pIns->GetSamples(); - bool hasSamples = false; - for(std::set<SAMPLEINDEX>::const_iterator sample = referencedSamples.begin(); sample != referencedSamples.end(); sample++) - { - if(*sample > 0 && *sample <= m_pSndFile->GetNumSamples() && m_pSndFile->GetSample(*sample).pSample != nullptr) - { - hasSamples = true; - break; - } - } - - if(!hasSamples || Reporting::Confirm("Remove sample associations of this instrument?") == cnfYes) - { - pIns->AssignSample(0); - m_NoteMap.Invalidate(); - } - } - m_pModDoc->UpdateAllViews(NULL, HINT_MIXPLUGINS, NULL); } #endif // NO_VST } - if(plugin.pMixPlugin) + if(plugin.pMixPlugin != nullptr) { ::EnableWindow(::GetDlgItem(m_hWnd, IDC_INSVIEWPLG), true); - // if this plug can recieve MIDI events and we have no MIDI channel - // selected for this instrument, automatically select MIDI channel 1. - if(plugin.pMixPlugin->isInstrument() && pIns->nMidiChannel == 0) + if(!IsLocked() && plugin.pMixPlugin->isInstrument()) { - pIns->nMidiChannel = 1; - UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT, NULL); + if(pIns->nMidiChannel == MidiNoChannel) + { + // If this plugin can recieve MIDI events and we have no MIDI channel + // selected for this instrument, automatically select MIDI channel 1. + pIns->nMidiChannel = MidiFirstChannel; + UpdateView((m_nInstrument << HINT_SHIFT_INS) | HINT_INSTRUMENT, NULL); + } + + // If we just dialled up an instrument plugin, zap the sample assignments. + const std::set<SAMPLEINDEX> referencedSamples = pIns->GetSamples(); + bool hasSamples = false; + for(std::set<SAMPLEINDEX>::const_iterator sample = referencedSamples.begin(); sample != referencedSamples.end(); sample++) + { + if(*sample > 0 && *sample <= m_pSndFile->GetNumSamples() && m_pSndFile->GetSample(*sample).pSample != nullptr) + { + hasSamples = true; + break; + } + } + + if(!hasSamples || Reporting::Confirm("Remove sample associations of this instrument?") == cnfYes) + { + pIns->AssignSample(0); + m_NoteMap.Invalidate(); + } } return; } Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2012-04-02 17:59:09 UTC (rev 1240) +++ trunk/OpenMPT/mptrack/version.h 2012-04-02 18:17:00 UTC (rev 1241) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 20 #define VER_MINOR 00 -#define VER_MINORMINOR 82 +#define VER_MINORMINOR 83 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |