|
resonance 1.0.1
|
Remove one saved remix from a card and rewrite the index it was listed in. More...
#include <deleteremixmct.h>


Public Member Functions | |
| DeleteRemixMCT (MemcardUser *pUser, Memcard *pCard, int nPortSlot, int nCookie, const HxStr &remixName) | |
| Construct an idle deletion. | |
| virtual | ~DeleteRemixMCT () |
| void | ListRemixDir () |
| List every remix save directory on the card. | |
| void | DeleteNextFile () |
| Run the deletion step mStep selects. | |
| virtual void | OnListDir (ListDirOp *pOp) |
| Collect the listed directories and read the first one's index. | |
| virtual void | OnCheckInfo (CheckInfoOp *pOp) |
| Start the listing unless the card reported that it cannot be read. | |
| virtual void | OnDeleteFile (DeleteFileOp *pOp) |
| Advance the deletion, abandoning the task first when the deletion failed. | |
| virtual void | Finish () |
| Report the finished deletion through MemcardUser::OnRemixDeleted(). | |
| virtual void | Execute () |
| Enquire about the card and start the deletion. | |
| virtual void | OnFileLoaded (int nStatus) |
| Search one index for the remix. | |
| virtual void | OnFileSaved (int nStatus) |
| Record the status of the index rewrite and advance to the next step. | |
| 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 | 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 |
Remove one saved remix from a card and rewrite the index it was listed in.
Its RTTI descriptor is at 0x00902370. 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 0x007da698 and the 21-entry MemcardUser table at 0x007da5e8, whose first two entries and whose slots 19 and 20 adjust this back by 28. Slot 20 needs a thunk here and not in LoadRemixMCT, because this class overrides it. An instance is 0x7c bytes, from the constructor's highest store at +0x78. No class derives from it. The size 0x7c is therefore a lower bound.
The task enquires about the card, lists /BASCUS-97125r*, reads each index to find the remix, deletes the payload file, and then saves the shortened index. It has two inner tasks, a LoadFileMCT at +0x50 and a SaveFileMCT at +0x54, and receives both reports as a MemcardUser. It therefore derives from both interfaces and is the only one of the four remix tasks that overrides OnFileSaved().
mStep is 1 while indexes are read, 2 once the remix is found, 3 once the shortened index is saved, and 4 once the payload file is deleted.
The method titles ListRemixDir(), DeleteNextFile(), Execute(), and Finish() are inferred. No string in the image identifies any of them.
| DeleteRemixMCT::DeleteRemixMCT | ( | MemcardUser * | pUser, |
| Memcard * | pCard, | ||
| int | nPortSlot, | ||
| int | nCookie, | ||
| const HxStr & | remixName ) |
Construct an idle deletion.
mStatus and mStep are not written. A task that is read before it reports therefore exposes whatever those two words stored when the block was allocated.
| 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 to remove. |
|
virtual |
| void DeleteRemixMCT::ListRemixDir | ( | ) |
List every remix save directory on the card.
Clears mStep first.
| void DeleteRemixMCT::DeleteNextFile | ( | ) |
Run the deletion step mStep selects.
A failed step reports at once. In step 2 the index in mStream is parsed, the element whose FileName matches mFileName is erased (a missing one reports kMemcardStatusNoFile), the shortened index is written back into mStream, and a fresh SaveFileMCT saves it as <dir>/index under g_remixIconTitle plus the directory number, moving to step 3. In step 3 the payload <dir>/<mFileName> is deleted, moving to step 4. Step 4 reports. The European release gives the save the file name index, because its SaveFileMCT supplies the /.
|
virtual |
Collect the listed directories and read the first one's index.
The body is LoadRemixMCT::OnListDir()'s, except that mStream is rewound before the read.
| pOp | The finished listing. |
Reimplemented from MemcardCBHandler.
|
virtual |
Start the listing unless the card reported that it cannot be read.
| pOp | The finished enquiry. |
Reimplemented from MemcardCBHandler.
|
virtual |
Advance the deletion, abandoning the task first when the deletion failed.
The next step runs whether the deletion succeeded or not, because the abandon path is taken before the step call rather than instead of it.
| pOp | The finished deletion. |
Reimplemented from MemcardCBHandler.
|
virtual |
Report the finished deletion through MemcardUser::OnRemixDeleted().
Implements MemcardTask.
|
virtual |
Enquire about the card and start the deletion.
Implements MemcardTask.
|
virtual |
Search one index for the remix.
A failed read abandons the task, and the body then continues all the same. mStep becomes 1 and the index is parsed from mStream. The first element whose RemixName matches mRemixName records its FileName in mFileName, rewinds mStream for DeleteNextFile(), and moves to step 2. With no match the next directory's index is read, and with none left the task reports kMemcardStatusNoFile.
| nStatus | The inner read's status. |
Reimplemented from MemcardUser.
|
virtual |
Record the status of the index rewrite and advance to the next step.
| nStatus | One of MemcardStatus. |
Reimplemented from MemcardUser.