Forums » General Questions » Song::GuessWhatTheseFilesAreForAndHopeForTheBest

1
From MsdFile.cpp:
/* Unfortunately, many of these files are missing ;'s.
* If we get a # when we thought we were inside a value, assume we
* missed the ;. Back up and end the value. */

So # in the song title or any other field doesn't work, the field ends up blank, or with some truncated value. Why does #SELFIE work then? Well that's where Song::GuessWhatTheseFilesAreForAndHopeForTheBest comes in.
// Fall back on the song directory name.
if(m_sMainTitle == "")
{
NotesLoader::GetMainAndSubTitlesFromFullTitle(Basename(this->GetSongDir()), m_sMainTitle, m_sSubTitle);
}

If the main title is blank, look at the directory name and use that for the title.
if(!m_bHasMusic)
{
// If the first song is "intro", and we have more than one available,
// don't use it--it's probably a KSF intro music file, which we don't
// (yet) support.
if(!music_list.empty())
{
LOG->Trace("Song '%s' points to a music file that doesn't exist, found music file '%s'", m_sSongDir.c_str(), music_list[0].c_str());
m_bHasMusic= true;
m_sMusicFile= music_list[0];
if(music_list.size() > 1 && !m_sMusicFile.Left(5).CompareNoCase("intro"))
{
m_sMusicFile= music_list[1];
}
}
}

If the music named in the simfile wasn't found, look through the folder and use the first music file found. Unless it's named intro, because KSF gives that a special meaning.

The list goes on, finding music, images, movies, and lyrics, and guessing what each is intended to be.
Images can be used for a variety of different things, but to limit mistakes, an image will only be used for one thing, and this is the order they are filled in:
1. Banners are anything containing "banner" in the name or ending with " bn" (yes, with a space before the bn), or with a width over 20 0 and an aspect ratio over 2.0.
2. Backgrounds are anything containing "background" or ending with "bg" (no space this time? I am not responsible for old decisions), or width >= 320 and height >= 240.
3. Jackets start with "jk_" or contain "jacket" or contain "albumart" or any square image.
4. A CD Image (not be confused with a cd title) ends with "-cd". Or they're a square image that wasn't already used for the jacket.
5. Next is the Disc (a rectangular graphic, not to be confused with CDImage above). This can end with " disc" or " title" (note the spaces again). If there isn't one matching that, a rectangular (width > height) image will be used if there's already a banner.
6. The cdtitle is anything containing "cdtitle" or a width <= 100 and height <= 48.

At least lyrics and movies are simple. If the extension is lrc, it's the lyric file. The first file with a supported video format extension is added as a simple bgchange.


Anyway, if you're wondering what stepmania is doing when caching simfiles, it's doing that and calculating radar values. The cache exists to allow skipping all that time consuming work.
< cybik> til Kyzentun fixes bugs for breakfast
--
< maxvg1> shakesoda: then why do i still play lol
<@shakesoda> because you're an ITG player. And thus, a masochist
--
<@shakesoda> Kyzentun: I think you might need to put down the meshes for a bit
Reply
Cheers for the writeup Kyzentun. I really appreciate that you post stuff you find out when looking at the stepmania source code, and I'm sure a lot of other people do too. :)
Reply