Etterna 0.74.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SMLoader Struct Reference

Reads a Song from an .SM file. More...

#include <NotesLoaderSM.h>

Inheritance diagram for SMLoader:
Inheritance graph
[legend]

Public Member Functions

 SMLoader (std::string ext)
 
virtual bool LoadFromDir (const std::string &sPath, Song &out)
 Attempt to load a song from a specified path.
 
virtual bool LoadNoteDataFromSimfile (const std::string &path, Steps &out)
 Retrieve the relevant notedata from the simfile.
 
virtual bool LoadFromSimfile (const std::string &sPath, Song &out, bool bFromCache=false)
 Attempt to load the specified sm file.
 
virtual void GetApplicableFiles (const std::string &sPath, std::vector< std::string > &out)
 Retrieve the list of .sm files.
 
virtual bool LoadFromBGChangesString (BackgroundChange &change, const std::string &sBGChangeExpression)
 
void ParseBPMs (std::vector< std::pair< float, float > > &out, const std::string &line, const int rowsPerBeat=-1)
 Parse BPM Changes data from a string.
 
void ProcessBPMs (TimingData &out, const std::vector< std::pair< float, float > > &vBPMChanges)
 Process the BPM Segments from the string.
 
void ParseStops (std::vector< std::pair< float, float > > &out, const std::string &line, const int rowsPerBeat=-1)
 Parse Stops data from a string.
 
void ProcessStops (TimingData &out, const std::vector< std::pair< float, float > > &vStops)
 Process the Stop Segments from the data.
 
void ProcessBPMsAndStops (TimingData &out, std::vector< std::pair< float, float > > &vBPMs, std::vector< std::pair< float, float > > &vStops)
 Process BPM and stop segments from the data.
 
void ProcessDelays (TimingData &out, const std::string &line, const int rowsPerBeat=-1)
 Process the Delay Segments from the string.
 
void ProcessTimeSignatures (TimingData &out, const std::string &line, const int rowsPerBeat=-1)
 Process the Time Signature Segments from the string.
 
void ProcessTickcounts (TimingData &out, const std::string &line, const int rowsPerBeat=-1)
 Process the Tickcount Segments from the string.
 
virtual void ProcessSpeeds (TimingData &out, const std::string &line, const int rowsPerBeat=-1)
 Process the Speed Segments from the string.
 
virtual void ProcessCombos (TimingData &, const std::string &line, const int=-1)
 
virtual void ProcessFakes (TimingData &out, const std::string &line, const int rowsPerBeat=-1)
 Process the Fake Segments from the string.
 
virtual void ProcessBGChanges (Song &out, const std::string &sValueName, const std::string &sPath, const std::string &sParam)
 
void ProcessInstrumentTracks (Song &out, const std::string &sParam)
 
virtual void SetSongTitle (const std::string &title)
 Set the song title.
 
virtual std::string GetSongTitle () const
 Get the song title.
 

Static Public Member Functions

static void TidyUpData (Song &song, bool bFromCache)
 Perform some cleanup on the loaded song.
 
static void ProcessDelays (TimingData &out, const std::string &line, const std::string &songname, const int rowsPerBeat=-1)
 
static void ProcessTimeSignatures (TimingData &out, const std::string &line, const std::string &songname, const int rowsPerBeat=-1)
 
static void ProcessTickcounts (TimingData &out, const std::string &line, const std::string &songname, const int rowsPerBeat=-1)
 
static void ProcessSpeeds (TimingData &out, const std::string &line, const std::string &songname, const int rowsPerBeat=-1)
 
static void ProcessFakes (TimingData &out, const std::string &line, const std::string &songname, const int rowsPerBeat=-1)
 
static float RowToBeat (const std::string &line, const int rowsPerBeat)
 Convert a row value to the proper beat value.
 

Protected Member Functions

virtual void LoadFromTokens (std::string sStepsType, std::string sDescription, std::string sDifficulty, std::string sMeter, std::string sNoteData, Steps &out)
 Process the different tokens we have available to get NoteData.
 
std::string GetFileExtension () const
 Retrieve the file extension associated with this loader.
 
std::string GetChartPath () const
 Get the chart path.
 

Detailed Description

Reads a Song from an .SM file.

Member Function Documentation

◆ GetApplicableFiles()

void SMLoader::GetApplicableFiles ( const std::string &  sPath,
std::vector< std::string > &  out 
)
virtual

Retrieve the list of .sm files.

Parameters
sPatha const reference to the path on the hard drive to check.
outa vector of files found in the path.

◆ GetChartPath()

std::string SMLoader::GetChartPath ( ) const
inlineprotected

Get the chart path.

Returns
the chart path.

◆ GetFileExtension()

std::string SMLoader::GetFileExtension ( ) const
inlineprotected

Retrieve the file extension associated with this loader.

Returns
the file extension.

◆ GetSongTitle()

std::string SMLoader::GetSongTitle ( ) const
virtual

Get the song title.

Returns
the song title.

◆ LoadFromDir()

bool SMLoader::LoadFromDir ( const std::string &  sPath,
Song out 
)
virtual

Attempt to load a song from a specified path.

Parameters
sPatha const reference to the path on the hard drive to check.
outa reference to the Song that will retrieve the song information.
Returns
its success or failure.

◆ LoadFromSimfile()

bool SMLoader::LoadFromSimfile ( const std::string &  sPath,
Song out,
bool  bFromCache = false 
)
virtual

Attempt to load the specified sm file.

Parameters
sPatha const reference to the path on the hard drive to check.
outa reference to the Song that will retrieve the song information.
bFromCachea check to see if we are getting certain information from the cache file.
Returns
its success or failure.

Reimplemented in SMALoader, and SSCLoader.

◆ LoadFromTokens()

void SMLoader::LoadFromTokens ( std::string  sStepsType,
std::string  sDescription,
std::string  sDifficulty,
std::string  sMeter,
std::string  sNoteData,
Steps out 
)
protectedvirtual

Process the different tokens we have available to get NoteData.

Parameters
stepsTypeThe current StepsType.
descriptionThe description of the chart.
difficultyThe difficulty (in words) of the chart.
meterthe difficulty (in numbers) of the chart.
radarValuesthe calculated radar values.
noteDatathe note data itself.
outthe Steps getting the data.

◆ LoadNoteDataFromSimfile()

bool SMLoader::LoadNoteDataFromSimfile ( const std::string &  path,
Steps out 
)
virtual

Retrieve the relevant notedata from the simfile.

Parameters
paththe path where the simfile lives.
outthe Steps we are loading the data into.

Reimplemented in SSCLoader.

◆ ParseBPMs()

void SMLoader::ParseBPMs ( std::vector< std::pair< float, float > > &  out,
const std::string &  line,
const int  rowsPerBeat = -1 
)

Parse BPM Changes data from a string.

Parameters
outthe vector to put the data in.
linethe string in question.
rowsPerBeatthe number of rows per beat for this purpose.

◆ ParseStops()

void SMLoader::ParseStops ( std::vector< std::pair< float, float > > &  out,
const std::string &  line,
const int  rowsPerBeat = -1 
)

Parse Stops data from a string.

Parameters
outthe vector to put the data in.
linethe string in question.
rowsPerBeatthe number of rows per beat for this purpose.

◆ ProcessBPMs()

void SMLoader::ProcessBPMs ( TimingData out,
const std::vector< std::pair< float, float > > &  vBPMChanges 
)

Process the BPM Segments from the string.

Parameters
outthe TimingData being modified.
vBPMChangesthe vector of BPM Changes data.

◆ ProcessBPMsAndStops()

void SMLoader::ProcessBPMsAndStops ( TimingData out,
std::vector< std::pair< float, float > > &  vBPMs,
std::vector< std::pair< float, float > > &  vStops 
)

Process BPM and stop segments from the data.

Parameters
outthe TimingData being modified.
vBPMsthe vector of BPM changes.
vStopsthe vector of stops.

◆ ProcessDelays()

void SMLoader::ProcessDelays ( TimingData out,
const std::string &  line,
const int  rowsPerBeat = -1 
)

Process the Delay Segments from the string.

Parameters
outthe TimingData being modified.
linethe string in question.
rowsPerBeatthe number of rows per beat for this purpose.

◆ ProcessFakes()

void SMLoader::ProcessFakes ( TimingData out,
const std::string &  line,
const int  rowsPerBeat = -1 
)
virtual

Process the Fake Segments from the string.

Parameters
outthe TimingData being modified.
linethe string in question.
rowsPerBeatthe number of rows per beat for this purpose.

◆ ProcessSpeeds()

void SMLoader::ProcessSpeeds ( TimingData out,
const std::string &  line,
const int  rowsPerBeat = -1 
)
virtual

Process the Speed Segments from the string.

Parameters
outthe TimingData being modified.
linethe string in question.
rowsPerBeatthe number of rows per beat for this purpose.

Reimplemented in SMALoader.

◆ ProcessStops()

void SMLoader::ProcessStops ( TimingData out,
const std::vector< std::pair< float, float > > &  vStops 
)

Process the Stop Segments from the data.

Parameters
outthe TimingData being modified.
vStopsthe vector of Stops data.

◆ ProcessTickcounts()

void SMLoader::ProcessTickcounts ( TimingData out,
const std::string &  line,
const int  rowsPerBeat = -1 
)

Process the Tickcount Segments from the string.

Parameters
outthe TimingData being modified.
linethe string in question.
rowsPerBeatthe number of rows per beat for this purpose.

◆ ProcessTimeSignatures()

void SMLoader::ProcessTimeSignatures ( TimingData out,
const std::string &  line,
const int  rowsPerBeat = -1 
)

Process the Time Signature Segments from the string.

Parameters
outthe TimingData being modified.
linethe string in question.
rowsPerBeatthe number of rows per beat for this purpose.

◆ RowToBeat()

float SMLoader::RowToBeat ( const std::string &  line,
const int  rowsPerBeat 
)
static

Convert a row value to the proper beat value.

This is primarily used for assistance with converting SMA files.

Parameters
lineThe line that contains the value.
rowsPerBeatthe number of rows per beat according to the original file.
Returns
the converted beat value.

◆ SetSongTitle()

void SMLoader::SetSongTitle ( const std::string &  title)
virtual

Set the song title.

Parameters
tthe song title.

◆ TidyUpData()

void SMLoader::TidyUpData ( Song song,
bool  bFromCache 
)
static

Perform some cleanup on the loaded song.

Parameters
songa reference to the song that may need cleaning up.
bFromCachea flag to determine if this song is loaded from a cache file.

The documentation for this struct was generated from the following files: