From: <man...@us...> - 2013-04-10 16:51:07
|
Revision: 1810 http://sourceforge.net/p/modplug/code/1810 Author: manxorist Date: 2013-04-10 16:50:58 +0000 (Wed, 10 Apr 2013) Log Message: ----------- [Ref] Replace static CTuning *CModDoc::s_DefaultTuning; with static CTuning *CSoundFile::GetDefaultTuning() which kind of makes more sense for future extensibility. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/ModInstrument.cpp trunk/OpenMPT/soundlib/ModInstrument.h trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2013-04-10 09:10:49 UTC (rev 1809) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2013-04-10 16:50:58 UTC (rev 1810) @@ -2724,7 +2724,7 @@ Reporting::Notification(str); CriticalSection cs; - pIns->SetTuning(pIns->s_DefaultTuning); + pIns->SetTuning(m_pSndFile->GetDefaultTuning()); m_pModDoc->SetModified(); } Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2013-04-10 09:10:49 UTC (rev 1809) +++ trunk/OpenMPT/mptrack/test/test.cpp 2013-04-10 16:50:58 UTC (rev 1810) @@ -435,7 +435,7 @@ VERIFY_EQUAL_NONCONT(pIns->wMidiBank, 2); VERIFY_EQUAL_NONCONT(pIns->midiPWD, 8); - VERIFY_EQUAL_NONCONT(pIns->pTuning, pIns->s_DefaultTuning); + VERIFY_EQUAL_NONCONT(pIns->pTuning, pSndFile->GetDefaultTuning()); VERIFY_EQUAL_NONCONT(pIns->wPitchToTempoLock, 0); @@ -670,7 +670,7 @@ VERIFY_EQUAL_NONCONT(pIns->wMidiBank, 2); VERIFY_EQUAL_NONCONT(pIns->midiPWD, ins); - VERIFY_EQUAL_NONCONT(pIns->pTuning, pIns->s_DefaultTuning); + VERIFY_EQUAL_NONCONT(pIns->pTuning, pSndFile->GetDefaultTuning()); VERIFY_EQUAL_NONCONT(pIns->wPitchToTempoLock, 130); Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-10 09:10:49 UTC (rev 1809) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-10 16:50:58 UTC (rev 1810) @@ -208,13 +208,13 @@ #endif // MODPLUG_TRACKER } - csf.Instruments[i]->pTuning = csf.Instruments[i]->s_DefaultTuning; + csf.Instruments[i]->pTuning = csf.GetDefaultTuning(); } else //This 'else' happens probably only in case of corrupted file. { if(csf.Instruments[i]) - csf.Instruments[i]->pTuning = ModInstrument::s_DefaultTuning; + csf.Instruments[i]->pTuning = csf.GetDefaultTuning(); } } Modified: trunk/OpenMPT/soundlib/ModInstrument.cpp =================================================================== --- trunk/OpenMPT/soundlib/ModInstrument.cpp 2013-04-10 09:10:49 UTC (rev 1809) +++ trunk/OpenMPT/soundlib/ModInstrument.cpp 2013-04-10 16:50:58 UTC (rev 1810) @@ -156,7 +156,7 @@ nPluginVelocityHandling = PLUGIN_VELOCITYHANDLING_CHANNEL; nPluginVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE; - pTuning = s_DefaultTuning; + pTuning = CSoundFile::GetDefaultTuning(); AssignSample(sample); ResetNoteMap(); Modified: trunk/OpenMPT/soundlib/ModInstrument.h =================================================================== --- trunk/OpenMPT/soundlib/ModInstrument.h 2013-04-10 09:10:49 UTC (rev 1809) +++ trunk/OpenMPT/soundlib/ModInstrument.h 2013-04-10 16:50:58 UTC (rev 1810) @@ -82,7 +82,6 @@ uint16 wPitchToTempoLock; // BPM at which the samples assigned to this instrument loop correctly uint32 nResampling; // Resampling mode CTuning *pTuning; // sample tuning assigned to this instrument - static CTuning *s_DefaultTuning; InstrumentEnvelope VolEnv; // Volume envelope data InstrumentEnvelope PanEnv; // Panning envelope data Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-10 09:10:49 UTC (rev 1809) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-10 16:50:58 UTC (rev 1810) @@ -399,9 +399,6 @@ // -! NEW_FEATURE#0027 -CTuning* ModInstrument::s_DefaultTuning = 0; - - ////////////////////////////////////////////////////////// // CSoundFile @@ -1627,8 +1624,6 @@ s_pTuningsSharedBuiltIn->SetConstStatus(CTuningCollection::EM_CONST); #endif - ModInstrument::s_DefaultTuning = NULL; - return false; } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2013-04-10 09:10:49 UTC (rev 1809) +++ trunk/OpenMPT/soundlib/Sndfile.h 2013-04-10 16:50:58 UTC (rev 1810) @@ -198,6 +198,7 @@ static void DeleteStaticdata(); static CTuningCollection& GetBuiltInTunings() {return *s_pTuningsSharedBuiltIn;} static CTuningCollection& GetLocalTunings() {return *s_pTuningsSharedLocal;} + static CTuning *GetDefaultTuning() {return nullptr;} CTuningCollection& GetTuneSpecificTunings() {return *m_pTuningsTuneSpecific;} std::string GetNoteName(const int16&, const INSTRUMENTINDEX inst = INSTRUMENTINDEX_INVALID) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |