Files
itgmania212121/stepmania/src/SongManager.h
T

81 lines
2.3 KiB
C++
Raw Normal View History

2002-05-19 01:59:48 +00:00
#pragma once
2002-02-28 19:40:40 +00:00
/*
-----------------------------------------------------------------------------
Class: SongManager
2002-05-19 01:59:48 +00:00
Desc: Holder for all Songs and Notes. Also keeps track of the current
Song and Notes, and loads/saves statistics.
2002-02-28 19:40:40 +00:00
2002-05-19 01:59:48 +00:00
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
2002-02-28 19:40:40 +00:00
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Song.h"
2002-06-14 22:25:22 +00:00
#include "Course.h"
2002-02-28 19:40:40 +00:00
2002-06-14 22:25:22 +00:00
const int MAX_SONG_QUEUE_SIZE = 400; // this has to be gigantic to fit an "endless" number of songs
2002-02-28 19:40:40 +00:00
class SongManager
{
public:
2002-07-23 01:41:40 +00:00
SongManager( void(*callback)() );
2002-02-28 19:40:40 +00:00
~SongManager();
CArray<Song*, Song*> m_pSongs; // all songs that can be played
2002-02-28 19:40:40 +00:00
2002-07-23 01:41:40 +00:00
void InitSongArrayFromDisk( void(*callback)() );
2002-06-14 22:25:22 +00:00
void FreeSongArray();
void ReloadSongArray();
2002-03-06 08:25:09 +00:00
2002-02-28 19:40:40 +00:00
void ReadStatisticsFromDisk();
void SaveStatisticsToDisk();
2002-03-06 08:25:09 +00:00
CString GetGroupBannerPath( CString sGroupName );
2002-04-01 02:04:43 +00:00
void GetGroupNames( CStringArray &AddTo );
RageColor GetGroupColor( const CString &sGroupName );
RageColor GetSongColor( Song* pSong );
2002-04-16 17:31:00 +00:00
2002-07-23 01:41:40 +00:00
static CString ShortenGroupName( const CString &sOrigGroupName );
2002-04-01 02:04:43 +00:00
void GetSongsInGroup( const CString sGroupName, CArray<Song*,Song*> &AddTo );
2002-03-06 08:25:09 +00:00
2002-07-29 03:06:55 +00:00
// for Oni
CArray<Course, Course> m_aOniCourses;
// for Extra Stages
CArray<Course, Course> m_aExtraCourses;
2002-07-29 03:06:55 +00:00
// for Endless
CArray<Course, Course> m_aEndlessCourses;
2002-06-14 22:25:22 +00:00
void InitCoursesFromDisk();
void ReloadCourses();
void GetExtraStageInfo( bool bExtra2, CString sPreferredGroup, const StyleDef *s,
2002-08-01 13:42:56 +00:00
Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out );
2002-06-14 22:25:22 +00:00
/* Choose a random song from the current style. Return true
* if successful, false if no song could be found. */
bool ChooseRandomSong();
Song* GetSongFromPath( const CString &sSongPath );
2002-02-28 19:40:40 +00:00
protected:
2002-07-23 01:41:40 +00:00
void LoadStepManiaSongDir( CString sDir, void(*callback)() );
2002-03-06 08:25:09 +00:00
void LoadDWISongDir( CString sDir );
2002-08-30 20:49:56 +00:00
bool GetExtraStageInfoFromCourse( bool bExtra2, CString sPreferredGroup,
Song*& pSongOut, Notes*& pNotesOut, PlayerOptions& po_out, SongOptions& so_out );
void SanityCheckGroupDir( CString sDir ) const;
2002-09-10 07:11:29 +00:00
void AddGroup( CString sDir, CString sGroupDirName );
2002-08-30 20:49:56 +00:00
2002-04-16 17:31:00 +00:00
CStringArray m_arrayGroupNames;
2002-09-07 07:24:44 +00:00
CStringArray m_GroupBannerPaths; // each song group has a banner associated with it
2002-02-28 19:40:40 +00:00
};
2002-05-19 01:59:48 +00:00
extern SongManager* SONGMAN; // global and accessable from anywhere in our program