diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index 11191ea901..dfe36d5abc 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -13,8 +13,20 @@ #include "Steps.h" #include "PrefsManager.h" +/** + * @brief A custom .edit file can only be so big before we have to reject it. + */ const int MAX_EDIT_STEPS_SIZE_BYTES = 60*1024; // 60 KB +/** + * @brief Attempt to load any background changes in use by this song. + * + * This code is right now copied from NotesLoaderSM. There may be a time + * when we add to this code, or perhaps just refactor it properly. + * @param change a reference to the background change. + * @param sBGChangeExpression a reference to the list of changes to be made. + * @return its success or failure. + */ bool LoadFromBGSSCChangesString( BackgroundChange &change, const RString &sBGChangeExpression ) { vector aBGChangeValues; diff --git a/src/NotesLoaderSSC.h b/src/NotesLoaderSSC.h index 96d38fdfbe..675a91a2e8 100644 --- a/src/NotesLoaderSSC.h +++ b/src/NotesLoaderSSC.h @@ -1,5 +1,4 @@ -/* SSCLoader - Reads a Song and its Steps from a .SSC file. */ - +/** @brief SSCLoader - Reads a Song and its Steps from a .SSC file. */ #ifndef NotesLoaderSSC_H #define NotesLoaderSSC_H @@ -10,31 +9,74 @@ class Song; class Steps; class TimingData; +/** + * @brief The various states while parsing a .ssc file. + */ enum SSCLoadingStates { - GETTING_SONG_INFO, - GETTING_STEP_INFO, - GETTING_STEP_TIMING_INFO, - GETTING_NOTE_INFO, - NUM_SSCLoadingStates + GETTING_SONG_INFO, /**< Retrieving song information. */ + GETTING_STEP_INFO, /**< Retrieving step information. */ + GETTING_STEP_TIMING_INFO, /**< Retrieving a step's individual timing information. */ + GETTING_NOTE_INFO, /**< Retrieving the specific notes. This state may be deprecated. */ + NUM_SSCLoadingStates /**< The number of states used. */ }; +/** + * @brief The SSCLoader handles all of the parsing needed for .ssc files. + */ namespace SSCLoader { + /** + * @brief Attempt to load a song from a specified path. + * @param sPath a const reference to the path on the hard drive to check. + * @param out a reference to the Song that will retrieve the song information. + * @return its success or failure. + */ bool LoadFromDir( const RString &sPath, Song &out ); - + /** + * @brief Attempt to load the specified ssc file. + * @param sPath a const reference to the path on the hard drive to check. + * @param out a reference to the Song that will retrieve the song information. + * @param bFromCache a check to see if we are getting certain information from the cache file. + * @return its success or failure. + */ bool LoadFromSSCFile( const RString &sPath, Song &out, bool bFromCache = false ); + /** + * @brief Retrieve the list of .ssc files. + * @param sPath a const reference to the path on the hard drive to check. + * @param out a vector of files found in the path. + */ void GetApplicableFiles( const RString &sPath, vector &out ); + /** + * @brief Attempt to load an edit from the hard drive. + * @param sEditFilePath a path on the hard drive to check. + * @param slot the Profile of the user with the edit. + * @param bAddStepsToSong a flag to determine if we add the edit steps to the song file. + * @return its success or failure. + */ bool LoadEditFromFile( RString sEditFilePath, ProfileSlot slot, bool bAddStepsToSong ); + /** + * @brief Attempt to parse the edit file in question. + * @param msd the edit file itself. + * @param sEditFilePath a const reference to a path on the hard drive to check. + * @param slot the Profile of the user with the edit. + * @param bAddStepsToSong a flag to determine if we add the edit steps to the song file. + * @return its success or failure. + */ bool LoadEditFromMsd( const MsdFile &msd, const RString &sEditFilePath, ProfileSlot slot, bool bAddStepsToSong ); + /** + * @brief Perform some cleanup on the loaded song. + * @param song a reference to the song that may need cleaning up. + * @param bFromCache a flag to determine if this song is loaded from a cache file. + */ void TidyUpData( Song &song, bool bFromCache ); - } - #endif - -/* - * (c) 2011 Jason Felds +/** + * @file + * @author Jason Felds (c) 2011 + * + * @section LICENSE * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a