Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

SongUtil.h

Go to the documentation of this file.
00001 /* SongUtil - Utility functions that deal with Song. */ 00002 00003 #ifndef SONG_UTIL_H 00004 #define SONG_UTIL_H 00005 00006 #include "GameConstantsAndTypes.h" 00007 #include "Difficulty.h" 00008 00009 class Song; 00010 class Profile; 00011 struct XNode; 00012 00013 namespace SongUtil 00014 { 00015 CString MakeSortString( CString s ); 00016 void SortSongPointerArrayByTitle( vector<Song*> &arraySongPointers ); 00017 void SortSongPointerArrayByBPM( vector<Song*> &arraySongPointers ); 00018 void SortSongPointerArrayByGrade( vector<Song*> &arraySongPointers ); 00019 void SortSongPointerArrayByArtist( vector<Song*> &arraySongPointers ); 00020 void SortSongPointerArrayByDisplayArtist( vector<Song*> &arraySongPointers ); 00021 void SortSongPointerArrayByGroupAndDifficulty( vector<Song*> &arraySongPointers ); 00022 void SortSongPointerArrayByGroupAndTitle( vector<Song*> &arraySongPointers ); 00023 void SortSongPointerArrayByNumPlays( vector<Song*> &arraySongPointers, ProfileSlot slot, bool bDescending ); 00024 void SortSongPointerArrayByNumPlays( vector<Song*> &arraySongPointers, const Profile* pProfile, bool bDescending ); 00025 void SortSongPointerArrayByMeter( vector<Song*> &arraySongPointers, Difficulty dc ); 00026 CString GetSectionNameFromSongAndSort( const Song* pSong, SortOrder so ); 00027 void SortSongPointerArrayBySectionName( vector<Song*> &arraySongPointers, SortOrder so ); 00028 } 00029 00030 class SongID 00031 { 00032 CString sDir; 00033 00034 public: 00035 SongID() { Unset(); } 00036 void Unset() { FromSong(NULL); } 00037 void FromSong( const Song *p ); 00038 Song *ToSong() const; 00039 bool operator<( const SongID &other ) const 00040 { 00041 return sDir < other.sDir; 00042 } 00043 00044 XNode* CreateNode() const; 00045 void LoadFromNode( const XNode* pNode ); 00046 CString ToString() const; 00047 bool IsValid() const; 00048 }; 00049 00050 00051 #endif 00052 00053 /* 00054 * (c) 2001-2004 Chris Danford, Glenn Maynard 00055 * All rights reserved. 00056 * 00057 * Permission is hereby granted, free of charge, to any person obtaining a 00058 * copy of this software and associated documentation files (the 00059 * "Software"), to deal in the Software without restriction, including 00060 * without limitation the rights to use, copy, modify, merge, publish, 00061 * distribute, and/or sell copies of the Software, and to permit persons to 00062 * whom the Software is furnished to do so, provided that the above 00063 * copyright notice(s) and this permission notice appear in all copies of 00064 * the Software and that both the above copyright notice(s) and this 00065 * permission notice appear in supporting documentation. 00066 * 00067 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00068 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00069 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00070 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00071 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00072 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00073 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00074 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00075 * PERFORMANCE OF THIS SOFTWARE. 00076 */

Generated on Thu Jan 27 20:57:33 2005 for StepMania by doxygen 1.3.7