Etterna 0.74.4
Loading...
Searching...
No Matches
Functions
SongUtil Namespace Reference

A set of song utilities to make working with songs easier. More...

Functions

void GetSteps (const Song *pSong, std::vector< Steps * > &arrayAddTo, StepsType st=StepsType_Invalid, Difficulty dc=Difficulty_Invalid, int iMeterLow=-1, int iMeterHigh=-1, bool filteringSteps=false, const std::string &sDescription="", const std::string &sCredit="", bool bIncludeAutoGen=true, unsigned uHash=0, int iMaxToGet=-1)
 
auto GetOneSteps (const Song *pSong, StepsType st=StepsType_Invalid, Difficulty dc=Difficulty_Invalid, int iMeterLow=-1, int iMeterHigh=-1, bool filteringSteps=false, const std::string &sDescription="", const std::string &sCredit="", unsigned uHash=0, bool bIncludeAutoGen=true) -> Steps *
 
auto GetStepsByDifficulty (const Song *pSong, StepsType st, Difficulty dc, bool bIncludeAutoGen=true) -> Steps *
 
auto GetStepsByMeter (const Song *pSong, StepsType st, int iMeterLow, int iMeterHigh) -> Steps *
 
auto GetStepsByDescription (const Song *pSong, StepsType st, const std::string &sDescription) -> Steps *
 
auto GetStepsByCredit (const Song *pSong, StepsType st, const std::string &sCredit) -> Steps *
 
auto GetClosestNotes (const Song *pSong, StepsType st, Difficulty dc, bool bIgnoreLocked=false) -> Steps *
 
void AdjustDuplicateSteps (Song *pSong)
 
void DeleteDuplicateSteps (Song *pSong, std::vector< Steps * > &vSteps)
 
void MakeSortString (std::string &s)
 
auto MakeSortString (const std::string &in) -> std::string
 
void SortSongPointerArrayByTitle (std::vector< Song * > &vpSongsInOut)
 
void SortSongPointerArrayByBPM (std::vector< Song * > &vpSongsInOut)
 
void SortSongPointerArrayByWifeScore (std::vector< Song * > &v)
 
void SortSongPointerArrayByArtist (std::vector< Song * > &vpSongsInOut)
 
void SortSongPointerArrayByDisplayArtist (std::vector< Song * > &vpSongsInOut)
 
void SortSongPointerArrayByGenre (std::vector< Song * > &vpSongsInOut)
 
void SortSongPointerArrayByGroupAndTitle (std::vector< Song * > &vpSongsInOut)
 
void SortSongPointerArrayByGroupAndMSD (std::vector< Song * > &vpSongsInOut, Skillset ss)
 
void SortSongPointerArrayByNumPlays (std::vector< Song * > &vpSongsInOut, ProfileSlot slot, bool bDescending)
 
void SortSongPointerArrayByNumPlays (std::vector< Song * > &vpSongsInOut, const Profile *pProfile, bool bDescending)
 
void SortSongPointerArrayByStepsTypeAndMeter (std::vector< Song * > &vpSongsInOut, StepsType st, Difficulty dc)
 
auto GetSectionNameFromSongAndSort (const Song *pSong, SortOrder so) -> std::string
 
void SortSongPointerArrayBySectionName (std::vector< Song * > &vpSongsInOut, SortOrder so)
 
void SortSongPointerArrayByLength (std::vector< Song * > &vpSongsInOut)
 
void SortSongPointerArrayByDateAdded (std::vector< Song * > &vpSongsInOut)
 
void SortSongPointerArrayByAuthor (std::vector< Song * > &vpSongsInOut)
 
auto CompareSongPointersByGroup (const Song *pSong1, const Song *pSong2) -> int
 
auto IsEditDescriptionUnique (const Song *pSong, StepsType st, const std::string &sPreferredDescription, const Steps *pExclude) -> bool
 Determine if the requested description for an edit is unique.
 
auto IsChartNameUnique (const Song *pSong, StepsType st, const std::string &name, const Steps *pExclude) -> bool
 
auto MakeUniqueEditDescription (const Song *pSong, StepsType st, const std::string &sPreferredDescription) -> std::string
 
auto ValidateCurrentEditStepsDescription (const std::string &sAnswer, std::string &sErrorOut) -> bool
 
auto ValidateCurrentStepsDescription (const std::string &sAnswer, std::string &sErrorOut) -> bool
 
auto ValidateCurrentStepsCredit (const std::string &sAnswer, std::string &sErrorOut) -> bool
 
auto ValidateCurrentStepsChartName (const std::string &answer, std::string &error) -> bool
 
auto ValidateCurrentSongPreview (const std::string &answer, std::string &error) -> bool
 
auto ValidateCurrentStepsMusic (const std::string &answer, std::string &error) -> bool
 
void GetAllSongGenres (std::vector< std::string > &vsOut)
 
void GetPlayableStepsTypes (const Song *pSong, std::set< StepsType > &vOut)
 
void GetPlayableSteps (const Song *pSong, std::vector< Steps * > &vOut, bool filteringSteps=false)
 
auto IsStepsTypePlayable (Song *pSong, StepsType st) -> bool
 
auto IsStepsPlayable (Song *pSong, Steps *pSteps) -> bool
 
auto IsSongPlayable (Song *s) -> bool
 Determine if the song has any playable steps in the present game.
 
auto GetStepsTypeAndDifficultyFromSortOrder (SortOrder so, StepsType &st, Difficulty &dc) -> bool
 

Detailed Description

A set of song utilities to make working with songs easier.

Function Documentation

◆ IsEditDescriptionUnique()

bool SongUtil::IsEditDescriptionUnique ( const Song pSong,
StepsType  st,
const std::string &  sPreferredDescription,
const Steps pExclude 
) -> bool

Determine if the requested description for an edit is unique.

Parameters
pSongthe song the edit is for.
stthe steps type for the edit.
sPreferredDescriptionthe requested description.
pExcludethe steps that want the description.
Returns
true if it is unique, false otherwise.

◆ IsSongPlayable()

bool SongUtil::IsSongPlayable ( Song s) -> bool

Determine if the song has any playable steps in the present game.

Parameters
sthe current song.
Returns
true if the song has playable steps, false otherwise.