|
resonance 1.0.1
|
Write one remix to a card and add it to the index of the directory it lands in. More...
#include <saveremixmct.h>


Public Member Functions | |
| SaveRemixMCT (MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie, const HxStr &remixName, const std::vector< FreqAppearance > &appearances, const HxStr &levelName, int nAlbumNum) | |
| Construct an idle remix save. | |
| virtual | ~SaveRemixMCT () |
| Delete the inner save and the inner read. | |
| void | ListRemixDir () |
| List every remix save directory on the card. | |
| void | WriteIndex () |
| Rewrite the target directory's index with the saved remix, and save it. | |
| virtual void | OnCheckInfo (CheckInfoOp *pOp) |
| Start the listing unless the card cannot be read or has too little room. | |
| virtual void | OnListDir (ListDirOp *pOp) |
| Collect the listed directories and start the index walk. | |
| virtual void | Finish () |
| Report the finished save through MemcardUser::OnRemixSaved(). | |
| virtual void | Execute () |
| Enquire about the card and start the save. | |
| virtual void | OnFileLoaded (int nStatus) |
| Advance the index walk, or move from the target's index to the payload write. | |
| virtual void | OnFileSaved (int nStatus) |
| Advance past a finished write, or rewrite the index once the payload has been written. | |
| Public Member Functions inherited from MemcardTask | |
| MemcardTask (MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie) | |
| Construct an idle task against one card slot. | |
| MemcardTask (MemcardUser *pUser, Memcard *pCard, int nCookie) | |
| Construct an idle task that does not address a single card slot. | |
| virtual void | UnusedHook () |
| Do nothing. | |
| Public Member Functions inherited from MemcardCBHandler | |
| virtual | ~MemcardCBHandler () |
| Release the receiver. | |
| virtual void | OnEntSpace (EntSpaceOp *pOp) |
| Report a finished free-entry enquiry. | |
| virtual void | OnFormat (FormatOp *pOp) |
| Report a finished format. | |
| virtual void | OnUnformat (UnformatOp *pOp) |
| Report a finished unformat. | |
| virtual void | OnCreateDir (CreateDirOp *pOp) |
| Report a finished directory creation. | |
| virtual void | OnRead (ReadOp *pOp) |
| Report a finished read. | |
| virtual void | OnWrite (WriteOp *pOp) |
| Report a finished write. | |
| virtual void | OnOpenWrite (OpenWriteOp *pOp) |
| Report a finished open for writing. | |
| virtual void | OnOpenRead (OpenReadOp *pOp) |
| Report a finished open for reading. | |
| virtual void | OnClose (CloseOp *pOp) |
| Report a finished close. | |
| virtual void | OnSeek (SeekOp *pOp) |
| Report a finished seek. | |
| virtual void | OnDeleteFile (DeleteFileOp *pOp) |
| Report a finished file deletion. | |
| virtual void | OnRenameFile (RenameFileOp *pOp) |
| Report a finished rename. | |
| Public Member Functions inherited from MemcardUser | |
| virtual | ~MemcardUser () |
| Release the receiver. | |
| virtual void | OnConnectState (MemcardConnectState state, int nStatus) |
| Report the state of one slot. | |
| virtual void | OnAllConnectStates () |
| Report that every slot has been enquired about. | |
| virtual void | OnMinimumSaveSpace (int nPortSlot, int nSpace) |
| Report the space a save would need against the space a card has. | |
| virtual void | OnCardFormatted (int nPortSlot, int nStatus) |
| Report a finished format. | |
| virtual void | OnCardUnformatted (int nPortSlot, int nStatus) |
| Report a finished unformat. | |
| virtual void | OnPersonasSaved (int nPortSlot, int nStatus) |
| Report a finished save of the FreQ roster. | |
| virtual void | OnRemixSaved (int nPortSlot, int nStatus) |
| Report a finished save of one remix. | |
| virtual void | OnGlobalSettingsSaved (int nPortSlot, int nStatus) |
| Report a finished save of the global settings. | |
| virtual void | OnJukeboxPlayListSaved (int nPortSlot, int nStatus) |
| Report a finished save of a jukebox playlist. | |
| virtual void | OnRemixesListed (int nPortSlot, int nStatus) |
| Report a finished listing of the saved remixes. | |
| virtual void | OnRemixLoaded (int nPortSlot, int nStatus) |
| Report a finished load of one remix. | |
| virtual void | OnPersonasLoaded (int nPortSlot, int nStatus) |
| Report a finished load of the FreQ roster. | |
| virtual void | OnGlobalSettingsLoaded (int nPortSlot, int nStatus) |
| Report a finished load of the global settings. | |
| virtual void | OnJukeboxPlayListLoaded (int nPortSlot, int nStatus) |
| Report a finished load of a jukebox playlist. | |
| virtual void | OnRemixDeleted (int nPortSlot, int nStatus) |
| Report a finished deletion of one remix. | |
| virtual void | UnusedFirstReport (int nPortSlot, int nStatus) |
| Do nothing. | |
| virtual void | UnusedSecondReport (int nPortSlot, int nStatus) |
| Do nothing. | |
Additional Inherited Members | |
| Protected Member Functions inherited from MemcardTask | |
| void | HandleError () |
| Abandon the task when the last operation reported a failure. | |
| Protected Attributes inherited from MemcardTask | |
| MemcardUser * | mUser |
| Memcard * | mCard |
| int | mCookie |
| int | mPortSlot |
| int | mState |
| int | mStatus |
Write one remix to a card and add it to the index of the directory it lands in.
Its RTTI descriptor is at 0x008ef5e0. It has two public non-virtual bases, MemcardTask at offset 0 and MemcardUser at offset 28. Two vtables belong to the class, the 19-entry primary at 0x007da938 and the 21-entry MemcardUser table at 0x007da888, whose first two entries and whose slots 19 and 20 adjust this back by 28. An instance is 0xa4 bytes, from the constructor's highest store at +0xa0. No class derives from it. The size 0xa4 is therefore a lower bound rather than a settled size.
The task enquires about the card, rejects a card with fewer than kRemixSaveMinimumFreeClusters free clusters, lists /BASCUS-97125r*, and then reads the index out of each remix save directory (step 1), recording a RemixDirInfo for each. A directory whose index already lists a remix of the same name becomes the target and the save replaces that entry. Otherwise ChooseTargetDir() picks the first directory with room, or a fresh one. The task then reads the target's index (step 2), writes the payload from the shared log stream (step 3), and finally rewrites the target's index (step 4). It has a LoadFileMCT and a SaveFileMCT, and receives both reports as a MemcardUser. It therefore derives from both interfaces.
The European release derives the class from SaveFileMCT at offset 0 instead of MemcardTask, with MemcardUser at offset 0x41c. The primary vtable is at 0x0081e7a8, the MemcardUser table at 0x0081e6f8, and an instance is 0x4a0 bytes, from MemcardManager::CreateSaveRemixTask()'s allocation. Execute() lists the remix directories at once, without the card enquiry and its free-cluster test. Once the target's index is read, WriteIndex() hands the payload and the rewritten index to the inherited save sequence together. That sequence checks the space both files need. The task has an inner LoadFileMCT and no inner SaveFileMCT.
The method titles are inferred. No string in the image identifies any of them.
| SaveRemixMCT::SaveRemixMCT | ( | MemcardUser * | pUser, |
| Memcard * | pCard, | ||
| int | nPortSlot, | ||
| int | nCookie, | ||
| const HxStr & | remixName, | ||
| const std::vector< FreqAppearance > & | appearances, | ||
| const HxStr & | levelName, | ||
| int | nAlbumNum ) |
Construct an idle remix save.
MemcardManager::CreateSaveRemixTask() at 0x001f31c8 is the one caller. mStep and mTargetIndexStatus are not written.
| pUser | The receiver Finish() reports to. |
| pCard | The queue the task submits operations to. |
| nPortSlot | The packed port and slot. |
| nCookie | The tag that abandons exactly this task's operations. |
| remixName | The remix's name, copied into mRemixName. |
| appearances | The players' appearances, copied into mAppearances. |
| levelName | The level the remix was built over, copied into mLevelName. |
| nAlbumNum | The album number the index entry records. |
|
virtual |
Delete the inner save and the inner read.
The European release has no inner save.
| void SaveRemixMCT::ListRemixDir | ( | ) |
List every remix save directory on the card.
Unlike the other three remix tasks, this one does not clear mStep, because Execute() has already cleared it.
| void SaveRemixMCT::WriteIndex | ( | ) |
Rewrite the target directory's index with the saved remix, and save it.
The index read in step 2 is parsed again from the start of mStream, or started afresh at version 1 when that read failed. When mReplacing is set, the entry with the same RemixName is refreshed in place. Otherwise a new entry is appended. mStream then receives the rewritten index, and a fresh SaveFileMCT saves it with its icon files as <dir>/index.
The European release first sets mState to kMemcardTaskRunning and adds the payload from the shared log stream to SaveFileMCT::mFiles. It then adds the rewritten index as index and runs SaveFileMCT::Execute() with mTargetDir as the directory.
|
virtual |
Start the listing unless the card cannot be read or has too little room.
A card with fewer than kRemixSaveMinimumFreeClusters free clusters reports kMemcardStatusCardFull and abandons the task rather than proceeding to the listing. The European release inherits SaveFileMCT::OnCheckInfo() instead.
| pOp | The finished enquiry. |
Reimplemented from MemcardCBHandler.
|
virtual |
Collect the listed directories and start the index walk.
A failed listing collects nothing. With directories listed the first index is read in step
| pOp | The finished listing. |
Reimplemented from MemcardCBHandler.
|
virtual |
Report the finished save through MemcardUser::OnRemixSaved().
Implements MemcardTask.
|
virtual |
Enquire about the card and start the save.
The European release runs ListRemixDir() instead of the enquiry.
Implements MemcardTask.
|
virtual |
Advance the index walk, or move from the target's index to the payload write.
A failure outside step 2 abandons the task. In step 1 the index is parsed, recorded through AppendDirInfo(), and each element's file number raises the directory's highestFileNumber. An element named mRemixName makes this directory the target and its file name the payload file name, and step 2 starts. Otherwise the next directory is read, or the target and payload file name are chosen and step 2 starts. In step 2 the read status, success or not, is recorded in mTargetIndexStatus and step 3 writes the payload. In the European release step 3 runs WriteIndex() at once.
| nStatus | The inner read's status. |
Reimplemented from MemcardUser.
|
virtual |
Advance past a finished write, or rewrite the index once the payload has been written.
The status is recorded whether the write succeeded or not. A successful write at step 3 moves to step 4 and rewrites the index, and every other successful write reports the task finished.
| nStatus | One of MemcardStatus. |
Reimplemented from MemcardUser.