1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-17 16:28:13 +01:00

From Pokechu22: Rename gain to velocity on note tracks

"Velocity" is the technical term, and it's the term that's used everywhere.
"Gain" was probably only used because "gain" is used on wave tracks; since
note tracks aren't wave tracks (and shouldn't be treated as them) the
corresponding variables should be named velocity.
This commit is contained in:
Paul Licameli
2017-03-28 15:50:07 -04:00
parent c20a3526a6
commit 80984c9f1d
5 changed files with 12 additions and 12 deletions

View File

@@ -113,7 +113,7 @@ Track(projDirManager)
mSerializationLength = 0;
#ifdef EXPERIMENTAL_MIDI_OUT
mGain = 0;
mVelocity = 0;
#endif
mBottomNote = 24;
mPitchHeight = 5;
@@ -160,7 +160,7 @@ Track::Holder NoteTrack::Duplicate() const
duplicate->mVisibleChannels = mVisibleChannels;
duplicate->SetOffset(GetOffset());
#ifdef EXPERIMENTAL_MIDI_OUT
duplicate->SetGain(GetGain());
duplicate->SetVelocity(GetVelocity());
#endif
// This std::move is needed to "upcast" the pointer type
return std::move(duplicate);
@@ -782,7 +782,7 @@ bool NoteTrack::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
else if (!wxStrcmp(attr, wxT("velocity")) &&
XMLValueChecker::IsGoodString(strValue) &&
Internat::CompatibleToDouble(strValue, &dblValue))
mGain = (float) dblValue;
mVelocity = (float) dblValue;
#endif
else if (!wxStrcmp(attr, wxT("bottomnote")) &&
XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue))
@@ -838,7 +838,7 @@ void NoteTrack::WriteXML(XMLWriter &xmlFile) const
xmlFile.WriteAttr(wxT("isSelected"), this->GetSelected());
#ifdef EXPERIMENTAL_MIDI_OUT
xmlFile.WriteAttr(wxT("velocity"), (double) saveme->mGain);
xmlFile.WriteAttr(wxT("velocity"), (double) saveme->mVelocity);
#endif
xmlFile.WriteAttr(wxT("bottomnote"), saveme->mBottomNote);
xmlFile.WriteAttr(wxT("data"), wxString(data.str().c_str(), wxConvUTF8));