From: <man...@us...> - 2014-02-23 13:03:43
|
Revision: 3758 http://sourceforge.net/p/modplug/code/3758 Author: manxorist Date: 2014-02-23 13:03:33 +0000 (Sun, 23 Feb 2014) Log Message: ----------- [Ref] Move UI code from CSoundFile::DestroyInstrument into CModDoc::RemoveInstrument . Modified Paths: -------------- trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2014-02-23 11:39:54 UTC (rev 3757) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2014-02-23 13:03:33 UTC (rev 3758) @@ -815,9 +815,13 @@ if ((nIns) && (nIns <= m_SndFile.GetNumInstruments()) && (m_SndFile.Instruments[nIns])) { bool instrumentsLeft = false; - - if(m_SndFile.DestroyInstrument(nIns, askDeleteAssociatedSamples)) + ConfirmAnswer result = Reporting::Confirm("Remove samples associated with an instrument if they are unused?", "Removing instrument", true); + if(result == cnfCancel) { + return false; + } + if(m_SndFile.DestroyInstrument(nIns, (result == cnfYes) ? deleteAssociatedSamples : doNoDeleteAssociatedSamples)) + { CriticalSection cs; if (nIns == m_SndFile.m_nInstruments) m_SndFile.m_nInstruments--; for (UINT i=1; i<MAX_INSTRUMENTS; i++) if (m_SndFile.Instruments[i]) instrumentsLeft = true; Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2014-02-23 11:39:54 UTC (rev 3757) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2014-02-23 13:03:33 UTC (rev 3758) @@ -14,7 +14,6 @@ #ifdef MODPLUG_TRACKER #include "../mptrack/Mptrack.h" #include "../mptrack/Moddoc.h" -#include "../mptrack/Reporting.h" #include "../mptrack/TrackerSettings.h" #endif //MODPLUG_TRACKER #include "../common/AudioCriticalSection.h" @@ -163,17 +162,6 @@ { if(nInstr == 0 || nInstr >= MAX_INSTRUMENTS || !Instruments[nInstr]) return true; -#ifdef MODPLUG_TRACKER - if(removeSamples == askDeleteAssociatedSamples) - { - ConfirmAnswer result = Reporting::Confirm("Remove samples associated with an instrument if they are unused?", "Removing instrument", true); - if(result == cnfCancel) - { - return false; - } - removeSamples = (result == cnfYes) ? deleteAssociatedSamples : doNoDeleteAssociatedSamples; - } -#endif // MODPLUG_TRACKER if(removeSamples == deleteAssociatedSamples) { RemoveInstrumentSamples(nInstr); Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2014-02-23 11:39:54 UTC (rev 3757) +++ trunk/OpenMPT/soundlib/Sndfile.h 2014-02-23 13:03:33 UTC (rev 3758) @@ -171,9 +171,6 @@ { deleteAssociatedSamples, doNoDeleteAssociatedSamples, -#ifdef MODPLUG_TRACKER - askDeleteAssociatedSamples, -#endif // MODPLUG_TRACKER }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |