Files
itgmania212121/stepmania/src/MemoryCardManager.h
T

65 lines
1.8 KiB
C++
Raw Normal View History

#ifndef MemoryCardManager_H
#define MemoryCardManager_H
/*
-----------------------------------------------------------------------------
Class: MemoryCardManager
Desc: Holds user-chosen preferences that are saved between sessions.
Copyright (c) 2001-2003 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "GameConstantsAndTypes.h" // for MemoryCardState
#include "PlayerNumber.h"
2003-12-18 04:24:25 +00:00
#include "RageSound.h"
2003-12-18 07:46:21 +00:00
#include "arch/MemoryCard/MemoryCardDriver.h"
2003-12-17 10:20:53 +00:00
const CString MEM_CARD_MOUNT_POINT[NUM_PLAYERS] =
{
/* @ is importast; see RageFileManager LoadedDriver::GetPath */
"@mc1/",
"@mc2/",
};
class MemoryCardManager
{
public:
MemoryCardManager();
~MemoryCardManager();
void Update( float fDelta );
2003-12-17 10:20:53 +00:00
MemoryCardState GetCardState( PlayerNumber pn );
2003-12-17 10:20:53 +00:00
// CString GetOsMountDir( PlayerNumber pn ); // only valid when state = ready
2003-12-17 10:20:53 +00:00
void LockCards( bool bLock ); // prevent removing or changing of memory cards
void FlushAllDisks(); // force all files to be written to mounted memory cards
2003-12-17 10:20:53 +00:00
2004-03-23 22:33:14 +00:00
bool PathIsMemCard( CString sDir ) const;
2003-12-17 10:20:53 +00:00
protected:
void AssignUnassignedCards(); // do our best to assign a Device to each player
2003-12-18 07:46:21 +00:00
2003-12-17 10:20:53 +00:00
MemoryCardDriver *m_pDriver;
2003-12-18 07:46:21 +00:00
vector<UsbStorageDevice> m_vStorageDevices; // all currently connected
2003-12-17 10:20:53 +00:00
bool m_bCardsLocked;
bool m_bTooLate[NUM_PLAYERS]; // card was inserted after lock
bool m_bWriteError[NUM_PLAYERS]; // couldn't write to the card
2003-12-18 07:46:21 +00:00
UsbStorageDevice m_Device[NUM_PLAYERS]; // device in the memory card slot, NULL if none
2003-12-18 04:24:25 +00:00
RageSound m_soundReady;
RageSound m_soundError;
RageSound m_soundTooLate;
2003-12-18 04:24:25 +00:00
RageSound m_soundDisconnect;
};
extern MemoryCardManager* MEMCARDMAN; // global and accessable from anywhere in our program
#endif