Abstract common functionality.

This commit is contained in:
Jason Felds
2011-07-17 12:54:50 -04:00
parent 4a62093491
commit 09dc94cfe8
4 changed files with 28 additions and 54 deletions
+19
View File
@@ -68,6 +68,25 @@ RString BackgroundChange::GetTextDescription() const
return s;
}
RString BackgroundChange::ToString() const
{
/* TODO: Technically we need to double-escape the filename
* (because it might contain '=') and then unescape the value
* returned by the MsdFile. */
return ssprintf("%.3f=%s=%.3f=%d=%d=%d=%s=%s=%s=%s=%s",
this->m_fStartBeat,
SmEscape(this->m_def.m_sFile1).c_str(),
this->m_fRate,
this->m_sTransition == SBT_CrossFade, // backward compat
this->m_def.m_sEffect == SBE_StretchRewind, // backward compat
this->m_def.m_sEffect != SBE_StretchNoLoop, // backward compat
this->m_def.m_sEffect.c_str(),
this->m_def.m_sFile2.c_str(),
this->m_sTransition.c_str(),
SmEscape(RageColor::NormalizeColorString(this->m_def.m_sColor1)).c_str(),
SmEscape(RageColor::NormalizeColorString(this->m_def.m_sColor2)).c_str());
}
const RString BACKGROUND_EFFECTS_DIR = "BackgroundEffects/";
const RString BACKGROUND_TRANSITIONS_DIR = "BackgroundTransitions/";