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-06-24 22:04:31 +00:00
|
|
|
#include "GameplayStatistics.h"
|
2002-04-16 17:31:00 +00:00
|
|
|
//#include <d3dxmath.h> // for D3DXCOLOR
|
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:
|
|
|
|
|
SongManager();
|
|
|
|
|
~SongManager();
|
|
|
|
|
|
2002-06-14 22:25:22 +00:00
|
|
|
Song* m_pCurSong;
|
|
|
|
|
Notes* m_pCurNotes[NUM_PLAYERS];
|
|
|
|
|
Course* m_pCurCourse;
|
2002-04-16 17:31:00 +00:00
|
|
|
CString m_sPreferredGroup;
|
2002-03-19 07:09:49 +00:00
|
|
|
|
2002-06-24 22:04:31 +00:00
|
|
|
CArray<GameplayStatistics,GameplayStatistics> m_aGameplayStatistics[NUM_PLAYERS]; // for passing from Dancing to Results
|
2002-06-14 22:25:22 +00:00
|
|
|
|
|
|
|
|
|
2002-03-19 07:09:49 +00:00
|
|
|
CArray<Song*, Song*> m_pSongs; // all songs that can be played
|
2002-02-28 19:40:40 +00:00
|
|
|
|
|
|
|
|
void InitSongArrayFromDisk();
|
2002-06-14 22:25:22 +00:00
|
|
|
void FreeSongArray();
|
|
|
|
|
void ReloadSongArray();
|
2002-03-06 08:25:09 +00:00
|
|
|
|
2002-05-29 09:47:24 +00:00
|
|
|
|
|
|
|
|
Song* GetCurrentSong();
|
|
|
|
|
Notes* GetCurrentNotes( PlayerNumber p );
|
|
|
|
|
void SetCurrentSong( Song* pSong );
|
|
|
|
|
void SetCurrentNotes( PlayerNumber p, Notes* pNotes );
|
2002-06-14 22:25:22 +00:00
|
|
|
GameplayStatistics GetLatestGameplayStatistics( PlayerNumber p );
|
2002-02-28 19:40:40 +00:00
|
|
|
|
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
|
|
|
|
2002-03-19 07:09:49 +00:00
|
|
|
CString GetGroupBannerPath( CString sGroupName );
|
2002-04-01 02:04:43 +00:00
|
|
|
void GetGroupNames( CStringArray &AddTo );
|
2002-04-16 17:31:00 +00:00
|
|
|
D3DXCOLOR GetGroupColor( const CString &sGroupName );
|
|
|
|
|
|
|
|
|
|
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-06-14 22:25:22 +00:00
|
|
|
// for Courses
|
|
|
|
|
CArray<Course, Course> m_aCourses;
|
|
|
|
|
|
|
|
|
|
void InitCoursesFromDisk();
|
|
|
|
|
void ReloadCourses();
|
|
|
|
|
|
|
|
|
|
|
2002-02-28 19:40:40 +00:00
|
|
|
protected:
|
2002-03-06 08:25:09 +00:00
|
|
|
void LoadStepManiaSongDir( CString sDir );
|
|
|
|
|
void LoadDWISongDir( CString sDir );
|
|
|
|
|
CMapStringToString m_mapGroupToBannerPath; // each song group has a banner associated with it
|
2002-04-16 17:31:00 +00:00
|
|
|
CStringArray m_arrayGroupNames;
|
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
|