resonance 1.0.1
Loading...
Searching...
No Matches
memcardmanager.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4#include <vector>
5
7
10class HxStr;
11class JukeboxPlayList;
12class Memcard;
13class MemcardTask;
14class MemcardUser;
15class MetPersonaData;
16struct MetRemixRecord;
17
30public:
42
50
58
71 void Update();
72
80 void CreateGetConnectStateTask(int nPortSlot);
81
89 void CreateGetAllConnectStatesTask(std::vector<MemcardConnectState> *pStates);
90
98 void CreateMinimumSaveSpaceTask(int nPortSlot);
99
107 void CreateFormatTask(int nPortSlot);
108
118 void CreateUnformatTask(int nPortSlot);
119
128 void CreateSavePersonasTask(int nPortSlot, const std::vector<MetPersonaData *> &roster);
129
138 void CreateSaveGlobalSettingsTask(int nPortSlot, GlobalSettings *pSettings);
139
149 void CreateSaveJukeboxPlayListTask(int nPortSlot, JukeboxPlayList *pPlayList, int nIndex);
150
159 void CreateLoadPersonasTask(int nPortSlot, std::vector<MetPersonaData *> *pRoster);
160
169 void CreateLoadGlobalSettingsTask(int nPortSlot, GlobalSettings *pSettings);
170
180 void CreateLoadJukeboxPlayListTask(int nPortSlot, JukeboxPlayList *pPlayList, int nIndex);
181
193 void CreateSaveRemixTask(int nPortSlot,
194 const HxStr &remixName,
195 const std::vector<FreqAppearance> &appearances,
196 const HxStr &levelName,
197 int nAlbumNum);
198
207 void CreateListRemixesTask(int nPortSlot, std::vector<MetRemixRecord> *pRecords);
208
217 void CreateLoadRemixTask(int nPortSlot, const HxStr &remixName);
218
227 void CreateDeleteRemixTask(int nPortSlot, const HxStr &remixName);
228
237
238private:
239 // The last ticket handed out. Each task factory pre-increments it and uses the result as the
240 // task's cookie. +0x04
241 int mTicket;
242
243 // Tasks in the order they were queued. Update() services the front of it. +0x08
244 std::list<MemcardTask *> mTasks;
245
246 // The queue every task submits operations to. +0x0c
247 Memcard *mCard;
248};
Appearance of a player's avatar.
Definition freqappearance.h:39
Settings shared by every player and saved to the memory card apart from any persona.
Definition globalsettings.h:31
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Ordered list of the remixes queued in the jukebox.
Definition jukeboxplaylist.h:46
void CreateDeleteRemixTask(int nPortSlot, const HxStr &remixName)
Queue a DeleteRemixMCT.
void CreateLoadPersonasTask(int nPortSlot, std::vector< MetPersonaData * > *pRoster)
Queue a LoadPersonasMCT.
void CreateGetConnectStateTask(int nPortSlot)
Queue a GetConnectStateMCT for one slot.
void CreateFormatTask(int nPortSlot)
Queue a FormatCardMCT that formats one slot.
void CreateGetAllConnectStatesTask(std::vector< MemcardConnectState > *pStates)
Queue a GetAllConnectStatesMCT.
void CreateSavePersonasTask(int nPortSlot, const std::vector< MetPersonaData * > &roster)
Queue a SavePersonasMCT, which serialises the roster at once.
MemcardUser * mUser
The receiver each new task reports to.
Definition memcardmanager.h:236
void CreateSaveGlobalSettingsTask(int nPortSlot, GlobalSettings *pSettings)
Queue a SaveGlobalSettingsMCT, which serialises the settings at once.
void Update()
Advance the memory-card work by one frame.
static MemcardManager * shared()
Resolve the one instance, constructing it on first use.
void CreateLoadJukeboxPlayListTask(int nPortSlot, JukeboxPlayList *pPlayList, int nIndex)
Queue a LoadJukeboxPlayListMCT.
MemcardManager()
Construct an empty manager that owns a new MemcardPS2.
void CreateLoadRemixTask(int nPortSlot, const HxStr &remixName)
Queue a LoadRemixMCT.
void CreateMinimumSaveSpaceTask(int nPortSlot)
Queue a MinimumSaveSpaceMCT for one slot.
~MemcardManager()
Delete the queue and release the task list.
void CreateSaveJukeboxPlayListTask(int nPortSlot, JukeboxPlayList *pPlayList, int nIndex)
Queue a SaveJukeboxPlayListMCT, which serialises the playlist at once.
void CreateListRemixesTask(int nPortSlot, std::vector< MetRemixRecord > *pRecords)
Queue a ListRemixesMCT.
void CreateLoadGlobalSettingsTask(int nPortSlot, GlobalSettings *pSettings)
Queue a LoadGlobalSettingsMCT.
void CreateUnformatTask(int nPortSlot)
Queue a FormatCardMCT that unformats one slot.
void CreateSaveRemixTask(int nPortSlot, const HxStr &remixName, const std::vector< FreqAppearance > &appearances, const HxStr &levelName, int nAlbumNum)
Queue a SaveRemixMCT.
One multi-step piece of memory-card work, driven by the operations it queues.
Definition memcardtask.h:39
Receiver notified once a memory-card task has finished.
Definition memcarduser.h:24
Queue of memory-card operations, with one entry point per libmc call.
Definition memcard.h:29
Saved record of one player persona.
Definition metpersonadata.h:39
One remix in the catalogue, with the appearances of the players who recorded it.
Definition metremixrecord.h:36