Undoable action for edits to a music song. More...
#include <music_undo_actions.h>


Public Member Functions | |
| MusicSongEditAction (int song_index, zelda3::music::MusicSong before_snapshot, zelda3::music::MusicSong after_snapshot, zelda3::music::MusicBank *music_bank) | |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| std::string | Description () const override |
| Human-readable description (e.g., "Paint 12 tiles on map 5") | |
| size_t | MemoryUsage () const override |
| Approximate memory footprint for budget enforcement. | |
Public Member Functions inherited from yaze::editor::UndoAction | |
| virtual | ~UndoAction ()=default |
| virtual bool | CanMergeWith (const UndoAction &) const |
| virtual void | MergeWith (UndoAction &) |
Private Attributes | |
| int | song_index_ |
| zelda3::music::MusicSong | before_snapshot_ |
| zelda3::music::MusicSong | after_snapshot_ |
| zelda3::music::MusicBank * | music_bank_ |
Undoable action for edits to a music song.
Captures a full snapshot of the MusicSong before and after the edit so that Undo restores the before-state and Redo restores the after-state. Applies changes via a pointer to the owning MusicBank.
Definition at line 25 of file music_undo_actions.h.
|
inline |
Definition at line 27 of file music_undo_actions.h.
|
inlineoverridevirtual |
Implements yaze::editor::UndoAction.
Definition at line 36 of file music_undo_actions.h.
References before_snapshot_, yaze::zelda3::music::MusicBank::GetSong(), music_bank_, and song_index_.

|
inlineoverridevirtual |
Implements yaze::editor::UndoAction.
Definition at line 46 of file music_undo_actions.h.
References after_snapshot_, yaze::zelda3::music::MusicBank::GetSong(), music_bank_, and song_index_.

|
inlineoverridevirtual |
Human-readable description (e.g., "Paint 12 tiles on map 5")
Implements yaze::editor::UndoAction.
Definition at line 56 of file music_undo_actions.h.
References song_index_.
|
inlineoverridevirtual |
Approximate memory footprint for budget enforcement.
Reimplemented from yaze::editor::UndoAction.
Definition at line 60 of file music_undo_actions.h.
References after_snapshot_, before_snapshot_, and yaze::zelda3::music::MusicSong::segments.
|
private |
Definition at line 77 of file music_undo_actions.h.
Referenced by Description(), Redo(), and Undo().
|
private |
Definition at line 78 of file music_undo_actions.h.
Referenced by MemoryUsage(), and Undo().
|
private |
Definition at line 79 of file music_undo_actions.h.
Referenced by MemoryUsage(), and Redo().
|
private |
Definition at line 80 of file music_undo_actions.h.