From: <sag...@us...> - 2015-06-11 19:18:14
|
Revision: 5290 http://sourceforge.net/p/modplug/code/5290 Author: saga-games Date: 2015-06-11 19:18:07 +0000 (Thu, 11 Jun 2015) Log Message: ----------- [Fix] Tuning Dialog: Editing a note name no longer requires to remove the octave number first. Modified Paths: -------------- trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/soundlib/tuning.cpp trunk/OpenMPT/soundlib/tuning.h trunk/OpenMPT/soundlib/tuningbase.cpp trunk/OpenMPT/soundlib/tuningbase.h Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.cpp 2015-06-10 20:57:31 UTC (rev 5289) +++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2015-06-11 19:18:07 UTC (rev 5290) @@ -125,12 +125,12 @@ } void CTuningDialog::DeleteTreeItem(CTuningCollection* pTC) -//--------------------------------------------- +//-------------------------------------------------------- { if(!pTC) return; - m_pActiveTuning = NULL; + m_pActiveTuning = nullptr; const HTREEITEM temp = m_TreeItemTuningItemMap.GetMapping_21(TUNINGTREEITEM(pTC)); if(temp) { @@ -139,12 +139,12 @@ CTuningCollection* pTCprev = prevTTI.GetTC(); CTuningCollection* pTCnext = nextTTI.GetTC(); - if(pTCnext == NULL) + if(pTCnext == nullptr) pTCnext = GetpTuningCollection(nextTTI.GetT()); - if(pTCprev == NULL) + if(pTCprev == nullptr) pTCprev = GetpTuningCollection(prevTTI.GetT()); - if(pTCnext != NULL && pTCnext != m_pActiveTuningCollection) + if(pTCnext != nullptr && pTCnext != m_pActiveTuningCollection) m_pActiveTuningCollection = pTCnext; else { @@ -601,7 +601,7 @@ m_RatioEditApply = false; m_EditRatio.SetWindowText(mpt::ToString(m_pActiveTuning->GetRatio(note)).c_str()); m_NoteEditApply = false; - m_EditNotename.SetWindowText(m_pActiveTuning->GetNoteName(note).c_str()); + m_EditNotename.SetWindowText(m_pActiveTuning->GetNoteName(note, false).c_str()); m_EditRatio.Invalidate(); m_EditNotename.Invalidate(); Modified: trunk/OpenMPT/soundlib/tuning.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuning.cpp 2015-06-10 20:57:31 UTC (rev 5289) +++ trunk/OpenMPT/soundlib/tuning.cpp 2015-06-11 19:18:07 UTC (rev 5290) @@ -61,25 +61,25 @@ static RATIOTYPE Pow(const RATIOTYPE r, const STEPINDEXTYPE s) -//------------------------------------------------------------- +//------------------------------------------------------------ { if(s == 0) return 1; RATIOTYPE result = r; - STEPINDEXTYPE absS = (s > 0) ? s : -s; - for(STEPINDEXTYPE i = 1; i<absS; i++) result *= r; + STEPINDEXTYPE absS = std::abs(s); + for(STEPINDEXTYPE i = 1; i < absS; i++) result *= r; return (s > 0) ? result : 1/result; } CTuningRTI::CTuningRTI(const CTuning* const pTun) -//------------------------------------------ +//----------------------------------------------- { SetDummyValues(); if(pTun) TuningCopy(*this, *pTun); } void CTuningRTI::SetDummyValues() -//--------------------------------- +//------------------------------- { if(MayEdit(EM_RATIOS)) { @@ -94,11 +94,11 @@ bool CTuningRTI::CreateRatioTableGG(const std::vector<RATIOTYPE>& v, const RATIOTYPE r, const VRPAIR& vr, const NOTEINDEXTYPE ratiostartpos) -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------------------------------------------------ { if(v.size() == 0 || r <= 0) return true; - m_StepMin = vr.first; + m_StepMin = vr.first; ProSetGroupSize(static_cast<UNOTEINDEXTYPE>(v.size())); ProSetGroupRatio(r); @@ -119,7 +119,7 @@ bool CTuningRTI::ProCreateGroupGeometric(const std::vector<RATIOTYPE>& v, const RATIOTYPE& r, const VRPAIR& vr, const NOTEINDEXTYPE ratiostartpos) -//--------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------------------------------------------------------ { //Note: Setting finestep is handled by base class when CreateGroupGeometric is called. if(CreateRatioTableGG(v, r, vr, ratiostartpos)) return true; @@ -128,7 +128,7 @@ bool CTuningRTI::ProCreateGeometric(const UNOTEINDEXTYPE& s, const RATIOTYPE& r, const VRPAIR& vr) -//--------------------------------------------------------------- +//------------------------------------------------------------------------------------------------ { if(vr.second - vr.first + 1 > NOTEINDEXTYPE_MAX) return true; //Note: Setting finestep is handled by base class when CreateGeometric is called. @@ -146,12 +146,12 @@ return false; } -CTuningRTI::NOTESTR CTuningRTI::ProGetNoteName(const NOTEINDEXTYPE& x) const -//----------------------------------------------------- +CTuningRTI::NOTESTR CTuningRTI::ProGetNoteName(const NOTEINDEXTYPE& x, bool addOctave) const +//------------------------------------------------------------------------------------------ { if(GetGroupSize() < 1) { - return CTuning::ProGetNoteName(x); + return CTuning::ProGetNoteName(x, addOctave); } else { @@ -162,7 +162,13 @@ if(nmi != m_NoteNameMap.end()) { rValue = nmi->second; - (x >= 0) ? rValue += mpt::ToString(middlePeriodNumber + x/m_GroupSize) : rValue += mpt::ToString(middlePeriodNumber + (x+1)/m_GroupSize - 1); + if(addOctave) + { + if(x >= 0) + rValue += mpt::ToString(middlePeriodNumber + x / m_GroupSize); + else + rValue += mpt::ToString(middlePeriodNumber + (x + 1) / m_GroupSize - 1); + } } else { @@ -173,7 +179,13 @@ rValue += ":"; - (x >= 0) ? rValue += mpt::ToString(middlePeriodNumber + x/m_GroupSize) : rValue += mpt::ToString(middlePeriodNumber + (x+1)/m_GroupSize - 1); + if(addOctave) + { + if(x >= 0) + rValue += mpt::ToString(middlePeriodNumber + x/m_GroupSize); + else + rValue += mpt::ToString(middlePeriodNumber + (x+1)/m_GroupSize - 1); + } } return rValue; } @@ -185,7 +197,7 @@ //Without finetune CTuning::RATIOTYPE CTuningRTI::GetRatio(const NOTEINDEXTYPE& stepsFromCentre) const -//------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------- { if(stepsFromCentre < m_StepMin) return s_DefaultFallbackRatio; if(stepsFromCentre >= m_StepMin + static_cast<NOTEINDEXTYPE>(m_RatioTable.size())) return s_DefaultFallbackRatio; @@ -195,7 +207,7 @@ //With finetune CTuning::RATIOTYPE CTuningRTI::GetRatio(const NOTEINDEXTYPE& baseNote, const STEPINDEXTYPE& baseStepDiff) const -//---------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------------------------------------- { const STEPINDEXTYPE fsCount = static_cast<STEPINDEXTYPE>(GetFineStepCount()); if(fsCount == 0 || baseStepDiff == 0) @@ -222,7 +234,7 @@ fineStep = ((fsCount + 1) - (abs(baseStepDiff) % (fsCount+1))) % (fsCount+1); } - if(note < m_StepMin) return s_DefaultFallbackRatio; + if(note < m_StepMin) return s_DefaultFallbackRatio; if(note >= m_StepMin + static_cast<NOTEINDEXTYPE>(m_RatioTable.size())) return s_DefaultFallbackRatio; if(fineStep) return m_RatioTable[note - m_StepMin] * GetRatioFine(note, fineStep); @@ -231,7 +243,7 @@ CTuning::RATIOTYPE CTuningRTI::GetRatioFine(const NOTEINDEXTYPE& note, USTEPINDEXTYPE sd) const -//-------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- { if(GetFineStepCount() <= 0) return 1; @@ -244,7 +256,7 @@ { if(GetType() == TT_GEOMETRIC) { - return m_RatioTableFine[sd-1]; + return m_RatioTableFine[sd-1]; } if(GetType() == TT_GROUPGEOMETRIC) return m_RatioTableFine[GetRefNote(note) * GetFineStepCount() + sd - 1]; @@ -263,7 +275,7 @@ bool CTuningRTI::ProSetRatio(const NOTEINDEXTYPE& s, const RATIOTYPE& r) -//-------------------------------------------------------------- +//---------------------------------------------------------------------- { //Creating ratio table if doesn't exist. if(m_RatioTable.empty()) @@ -293,7 +305,7 @@ void CTuningRTI::ProSetFineStepCount(const USTEPINDEXTYPE& fs) -//----------------------------------------------------- +//------------------------------------------------------------ { if(fs <= 0) { @@ -360,7 +372,7 @@ CTuningRTI::NOTEINDEXTYPE CTuningRTI::GetRefNote(const NOTEINDEXTYPE note) const -//------------------------------------------------------ +//------------------------------------------------------------------------------ { if(!IsOfType(TT_GROUPGEOMETRIC)) return 0; @@ -370,7 +382,7 @@ CTuning* CTuningRTI::Deserialize(std::istream& iStrm) -//-------------------------------------------------- +//--------------------------------------------------- { if(iStrm.fail()) return nullptr; @@ -393,7 +405,7 @@ ssb.ReadItem(pTuning->m_SerHelperRatiotableSize, "RTI4"); // If reader status is ok and m_StepMin is somewhat reasonable, process data. - if ((ssb.GetStatus() & srlztn::SNT_FAILURE) == 0 && pTuning->m_StepMin >= -300 && pTuning->m_StepMin <= 300) + if ((ssb.GetStatus() & srlztn::SNT_FAILURE) == 0 && pTuning->m_StepMin >= -300 && pTuning->m_StepMin <= 300) { EDITMASK temp = pTuning->GetEditMask(); pTuning->m_EditMask = EM_ALLOWALL; //Allowing all while processing data. @@ -407,7 +419,7 @@ delete pTuning; pTuning = nullptr; } else - { + { USTEPINDEXTYPE fsTemp = pTuning->m_FineStepCount; pTuning->m_FineStepCount = 0; pTuning->SetFineStepCount(fsTemp); @@ -441,7 +453,7 @@ template<class T, class SIZETYPE> bool VectorFromBinaryStream(std::istream& inStrm, std::vector<T>& v, const SIZETYPE maxSize = (std::numeric_limits<SIZETYPE>::max)()) -//--------------------------------------------------------- +//----------------------------------------------------------------------------------------------------------------------------------- { if(!inStrm.good()) return true; @@ -464,7 +476,7 @@ CTuning::SERIALIZATION_RETURN_TYPE CTuningRTI::Serialize(std::ostream& outStrm) const -//---------------------------------------------------------------------------------- +//----------------------------------------------------------------------------------- { srlztn::SsbWrite ssb(outStrm); ssb.BeginWrite("CTB244RTI", (GetVersion() << 24) + GetClassVersion()); @@ -506,7 +518,7 @@ { void RatioWriter::operator()(std::ostream& oStrm, const std::vector<float>& v) -//--------------------------------------------------------------------------------- +//---------------------------------------------------------------------------- { const size_t nWriteCount = MIN(v.size(), m_nWriteCount); mpt::IO::WriteAdaptiveInt64LE(oStrm, nWriteCount); @@ -516,7 +528,7 @@ void ReadNoteMap(std::istream& iStrm, CTuning::NOTENAMEMAP& m, const size_t) -//---------------------------------------------------------------------------------- +//-------------------------------------------------------------------------- { uint64 val; mpt::IO::ReadAdaptiveInt64LE(iStrm, val); @@ -533,7 +545,7 @@ void ReadRatioTable(std::istream& iStrm, std::vector<CTuningRTI::RATIOTYPE>& v, const size_t) -//------------------------------------------------------------------------------------------ +//------------------------------------------------------------------------------------------- { uint64 val; mpt::IO::ReadAdaptiveInt64LE(iStrm, val); @@ -548,7 +560,7 @@ void ReadStr(std::istream& iStrm, std::string& str, const size_t) -//------------------------------------------------------------------- +//--------------------------------------------------------------- { uint64 val; mpt::IO::ReadAdaptiveInt64LE(iStrm, val); @@ -560,7 +572,7 @@ void WriteNoteMap(std::ostream& oStrm, const CTuning::NOTENAMEMAP& m) -//--------------------------------------------------------------------------- +//------------------------------------------------------------------- { mpt::IO::WriteAdaptiveInt64LE(oStrm, m.size()); CTuning::NNM_CITER iter = m.begin(); @@ -574,7 +586,7 @@ void WriteStr(std::ostream& oStrm, const std::string& str) -//----------------------------------------------------------------- +//-------------------------------------------------------- { mpt::IO::WriteAdaptiveInt64LE(oStrm, str.size()); oStrm.write(str.c_str(), str.size()); @@ -583,4 +595,4 @@ } // namespace CTuningS11n. -OPENMPT_NAMESPACE_END +OPENMPT_NAMESPACE_END \ No newline at end of file Modified: trunk/OpenMPT/soundlib/tuning.h =================================================================== --- trunk/OpenMPT/soundlib/tuning.h 2015-06-10 20:57:31 UTC (rev 5289) +++ trunk/OpenMPT/soundlib/tuning.h 2015-06-11 19:18:07 UTC (rev 5290) @@ -53,10 +53,10 @@ virtual STEPINDEXTYPE GetStepDistance(const NOTEINDEXTYPE& from, const NOTEINDEXTYPE& to) const {return (to - from)*(static_cast<NOTEINDEXTYPE>(GetFineStepCount())+1);} - + virtual STEPINDEXTYPE GetStepDistance(const NOTEINDEXTYPE& noteFrom, const STEPINDEXTYPE& stepDistFrom, const NOTEINDEXTYPE& noteTo, const STEPINDEXTYPE& stepDistTo) const {return GetStepDistance(noteFrom, noteTo) + stepDistTo - stepDistFrom;} - + static CTuning* Deserialize(std::istream& inStrm); static uint32 GetVersion() {return s_SerializationVersion;} @@ -65,8 +65,8 @@ static CTuningRTI* DeserializeOLD(std::istream&) {return 0;} SERIALIZATION_RETURN_TYPE Serialize(std::ostream& out) const; - + public: //PUBLIC CONSTRUCTORS/DESTRUCTORS: CTuningRTI(const std::vector<RATIOTYPE>& ratios, @@ -81,11 +81,11 @@ //Copy tuning. CTuningRTI(const CTuning* const pTun); - + CTuningRTI() {SetDummyValues();} CTuningRTI(const std::string& name) : CTuning(name) {SetDummyValues();} - + CTuningRTI(const NOTEINDEXTYPE& stepMin, const std::string& name) : CTuning(name) { SetDummyValues(); @@ -101,7 +101,7 @@ bool ProCreateGeometric(const UNOTEINDEXTYPE&, const RATIOTYPE&, const VRPAIR&); void ProSetFineStepCount(const USTEPINDEXTYPE&); - virtual NOTESTR ProGetNoteName(const NOTEINDEXTYPE& x) const; + virtual NOTESTR ProGetNoteName(const NOTEINDEXTYPE& xi, bool addOctave) const; //Not implemented. VRPAIR ProSetValidityRange(const VRPAIR&); @@ -113,8 +113,8 @@ virtual uint32 GetClassVersion() const {return GetVersion();} virtual bool ProProcessUnserializationdata(); - + //END PROTECTED VIRTUALS protected: @@ -125,7 +125,7 @@ //Note: Stepdiff should be in range [1, finestepcount] virtual RATIOTYPE GetRatioFine(const NOTEINDEXTYPE& note, USTEPINDEXTYPE stepDiff) const; - //GroupPeriodic-specific. + //GroupPeriodic-specific. //Get the corresponding note in [0, period-1]. //For example GetRefNote(-1) is to return note :'groupsize-1'. NOTEINDEXTYPE GetRefNote(NOTEINDEXTYPE note) const; @@ -137,7 +137,7 @@ //Sets dummy values for *this. void SetDummyValues(); - + bool IsNoteInTable(const NOTEINDEXTYPE& s) const { if(s < m_StepMin || s >= m_StepMin + static_cast<NOTEINDEXTYPE>(m_RatioTable.size())) @@ -152,26 +152,26 @@ //Noteratios std::vector<RATIOTYPE> m_RatioTable; - + //'Fineratios' std::vector<RATIOTYPE> m_RatioTableFine; - + //The lowest index of note in the table NOTEINDEXTYPE m_StepMin; // this should REALLY be called 'm_NoteMin' renaming was missed in r192 - + //For groupgeometric tunings, tells the 'group size' and 'group ratio' //m_GroupSize should always be >= 0. NOTEINDEXTYPE m_GroupSize; RATIOTYPE m_GroupRatio; - + //<----Actual data members mutable UNOTEINDEXTYPE m_SerHelperRatiotableSize; static const std::string s_DerivedclassID; - + }; //End: CTuningRTI declaration. -OPENMPT_NAMESPACE_END +OPENMPT_NAMESPACE_END \ No newline at end of file Modified: trunk/OpenMPT/soundlib/tuningbase.cpp =================================================================== --- trunk/OpenMPT/soundlib/tuningbase.cpp 2015-06-10 20:57:31 UTC (rev 5289) +++ trunk/OpenMPT/soundlib/tuningbase.cpp 2015-06-11 19:18:07 UTC (rev 5290) @@ -89,7 +89,7 @@ void CTuningBase::TuningCopy(CTuningBase& to, const CTuningBase& from, const bool allowExactnamecopy) -//------------------------------------------------------------------------------------ +//--------------------------------------------------------------------------------------------------- { if(!to.MayEdit(EM_ALLOWALL)) return; @@ -121,7 +121,7 @@ bool CTuningBase::SetRatio(const NOTEINDEXTYPE& s, const RATIOTYPE& r) -//----------------------------------------------------------------- +//-------------------------------------------------------------------- { if(MayEdit(EM_RATIOS)) { @@ -138,7 +138,7 @@ CTuningBase::USTEPINDEXTYPE CTuningBase::SetFineStepCount(const USTEPINDEXTYPE& fs) -//------------------------------------------------------- +//--------------------------------------------------------------------------------- { VRPAIR vrp = GetValidityRange(); @@ -157,7 +157,7 @@ CTuningBase::TUNINGTYPE CTuningBase::GetTuningType(const char* str) -//-------------------------------------------------------------------------- +//----------------------------------------------------------------- { if(!strcmp(str, s_TuningTypeStrGroupGeometric)) return TT_GROUPGEOMETRIC; @@ -169,7 +169,7 @@ std::string CTuningBase::GetTuningTypeStr(const TUNINGTYPE& tt) -//---------------------------------------------------------------- +//------------------------------------------------------------- { if(tt == TT_GENERAL) return s_TuningTypeStrGeneral; @@ -183,16 +183,16 @@ -CTuningBase::NOTESTR CTuningBase::GetNoteName(const NOTEINDEXTYPE& x) const -//----------------------------------------------------------------------- +CTuningBase::NOTESTR CTuningBase::GetNoteName(const NOTEINDEXTYPE& x, bool addOctave) const +//----------------------------------------------------------------------------------------- { if(!IsValidNote(x)) return ""; - else return ProGetNoteName(x); + else return ProGetNoteName(x, addOctave); } -CTuningBase::NOTESTR CTuningBase::ProGetNoteName(const NOTEINDEXTYPE& x) const -//------------------------------------------------------------------------------------- +CTuningBase::NOTESTR CTuningBase::ProGetNoteName(const NOTEINDEXTYPE& x, bool /*addOctave*/) const +//------------------------------------------------------------------------------------------------ { NNM_CITER i = m_NoteNameMap.find(x); if(i != m_NoteNameMap.end()) @@ -204,7 +204,7 @@ bool CTuningBase::IsOfType(const TUNINGTYPE& type) const -//---------------------------------------------------- +//------------------------------------------------------ { if(type == TT_GENERAL) return true; @@ -224,7 +224,7 @@ bool CTuningBase::SetNoteName(const NOTEINDEXTYPE& n, const std::string& str) -//----------------------------------------------------------------------- +//--------------------------------------------------------------------------- { if(MayEdit(EM_NOTENAME)) { @@ -238,7 +238,7 @@ bool CTuningBase::ClearNoteName(const NOTEINDEXTYPE& n, const bool eraseAll) -//------------------------------------------------------- +//-------------------------------------------------------------------------- { if(MayEdit(EM_NOTENAME)) { @@ -263,7 +263,7 @@ bool CTuningBase::Multiply(const RATIOTYPE& r) -//--------------------------------------------------- +//-------------------------------------------- { if(r <= 0 || !MayEdit(EM_RATIOS)) return true; @@ -281,7 +281,7 @@ bool CTuningBase::CreateGroupGeometric(const NOTEINDEXTYPE& s, const RATIOTYPE& r, const NOTEINDEXTYPE& startindex) -//------------------------------------------------------------- +//----------------------------------------------------------------------------------------------------------------- { if(s < 1 || r <= 0 || startindex < GetValidityRange().first) return true; @@ -295,7 +295,7 @@ bool CTuningBase::CreateGroupGeometric(const std::vector<RATIOTYPE>& v, const RATIOTYPE& r, const VRPAIR vr, const NOTEINDEXTYPE ratiostartpos) -//------------------------------------------------------------------------------------------ +//--------------------------------------------------------------------------------------------------------------------------------------------- { if(MayEdit(EM_RATIOS) && (MayEdit(EM_TYPE) || GetType() == TT_GROUPGEOMETRIC)) @@ -320,7 +320,7 @@ bool CTuningBase::CreateGeometric(const UNOTEINDEXTYPE& s, const RATIOTYPE& r, const VRPAIR vr) -//------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------- { if(MayEdit(EM_RATIOS) && (MayEdit(EM_TYPE) || GetType() == TT_GEOMETRIC)) @@ -344,7 +344,7 @@ bool CTuningBase::ChangeGroupsize(const NOTEINDEXTYPE& s) -//--------------------------------------------------- +//------------------------------------------------------- { if(!MayEdit(EM_RATIOS) || s < 1) return true; @@ -361,7 +361,7 @@ bool CTuningBase::ChangeGroupRatio(const RATIOTYPE& r) -//--------------------------------------------------- +//---------------------------------------------------- { if(!MayEdit(EM_RATIOS) || r <= 0) return true; @@ -378,7 +378,7 @@ const char* CTuningBase::GetTuningTypeDescription(const TUNINGTYPE& type) -//--------------------------------------------------------------------------------------- +//----------------------------------------------------------------------- { if(type == TT_GENERAL) return s_TuningDescriptionGeneral; @@ -391,7 +391,7 @@ CTuningBase::VRPAIR CTuningBase::SetValidityRange(const VRPAIR& vrp) -//---------------------------------------------------------------------------------------- +//------------------------------------------------------------------ { if(vrp.second < vrp.first) return GetValidityRange(); if(IsStepCountRangeSufficient(GetFineStepCount(), vrp) @@ -406,7 +406,7 @@ bool CTuningBase::SetType(const TUNINGTYPE& tt) -//---------------------------------------------- +//--------------------------------------------- { //Note: This doesn't check whether the tuning ratios //are consistent with given type. @@ -429,7 +429,7 @@ bool CTuningBase::DeserializeOLD(std::istream& inStrm) -//------------------------------------------------ +//---------------------------------------------------- { char begin[8]; int16 version; @@ -476,4 +476,4 @@ } -OPENMPT_NAMESPACE_END +OPENMPT_NAMESPACE_END \ No newline at end of file Modified: trunk/OpenMPT/soundlib/tuningbase.h =================================================================== --- trunk/OpenMPT/soundlib/tuningbase.h 2015-06-10 20:57:31 UTC (rev 5289) +++ trunk/OpenMPT/soundlib/tuningbase.h 2015-06-11 19:18:07 UTC (rev 5290) @@ -35,7 +35,7 @@ //RATIOTYPE: Some 'real figure' type able to present ratios. //STEPINDEXTYPE: Counter of steps between notes. If there is no 'finetune'(finestepcount == 0), //then 'step difference' between notes is the - //same as differences in NOTEINDEXTYPE. In a way similar to ticks and rows in pattern - + //same as differences in NOTEINDEXTYPE. In a way similar to ticks and rows in pattern - //ticks <-> STEPINDEX, rows <-> NOTEINDEX public: @@ -125,7 +125,7 @@ //Create GroupGeometric tuning of *this using virtual ProCreateGroupGeometric. bool CreateGroupGeometric(const std::vector<RATIOTYPE>&, const RATIOTYPE&, const VRPAIR vr, const NOTEINDEXTYPE ratiostartpos); - //Create GroupGeometric of *this using ratios from 'itself' and ratios starting from + //Create GroupGeometric of *this using ratios from 'itself' and ratios starting from //position given as third argument. bool CreateGroupGeometric(const NOTEINDEXTYPE&, const RATIOTYPE&, const NOTEINDEXTYPE&); @@ -135,10 +135,10 @@ virtual SERIALIZATION_RETURN_TYPE Serialize(std::ostream& /*out*/) const {return false;} - NOTESTR GetNoteName(const NOTEINDEXTYPE& x) const; + NOTESTR GetNoteName(const NOTEINDEXTYPE& x, bool addOctave = true) const; void SetName(const std::string& s); - + std::string GetName() const {return m_TuningName;} bool SetNoteName(const NOTEINDEXTYPE&, const std::string&); @@ -179,7 +179,7 @@ //Checking that step distances can be presented with //value range of STEPINDEXTYPE with given finestepcount and validityrange. bool IsStepCountRangeSufficient(USTEPINDEXTYPE fs, VRPAIR vrp); - + virtual const char* GetTuningTypeDescription() const; static const char* GetTuningTypeDescription(const TUNINGTYPE&); @@ -202,12 +202,12 @@ //tuningtype is automatically changed to general. virtual bool ProSetRatio(const NOTEINDEXTYPE&, const RATIOTYPE&) {return true;} - virtual NOTESTR ProGetNoteName(const NOTEINDEXTYPE&) const; + virtual NOTESTR ProGetNoteName(const NOTEINDEXTYPE&, bool) const; //The two methods below return false if action was done, true otherwise. virtual bool ProCreateGroupGeometric(const std::vector<RATIOTYPE>&, const RATIOTYPE&, const VRPAIR&, const NOTEINDEXTYPE /*ratiostartpos*/) {return true;} virtual bool ProCreateGeometric(const UNOTEINDEXTYPE&, const RATIOTYPE&, const VRPAIR&) {return true;} - + virtual VRPAIR ProSetValidityRange(const VRPAIR&) {return GetValidityRange();} virtual void ProSetFineStepCount(const USTEPINDEXTYPE&) {} @@ -325,4 +325,4 @@ } -OPENMPT_NAMESPACE_END +OPENMPT_NAMESPACE_END \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |