UI component for browsing and managing songs. More...
#include <song_browser_view.h>
Public Member Functions | |
| SongBrowserView ()=default | |
| ~SongBrowserView ()=default | |
| void | Draw (MusicBank &bank) |
| Draw the song browser. | |
| void | SetOnSongSelected (std::function< void(int)> callback) |
| Set callback for when a song is selected. | |
| void | SetOnEditCallback (std::function< void()> callback) |
| Set callback for when edits occur (e.g. renaming). | |
| void | SetOnEdit (std::function< void()> callback) |
| void | SetOnOpenTracker (std::function< void(int)> callback) |
| Set callback for opening tracker on a song. | |
| void | SetOnOpenPianoRoll (std::function< void(int)> callback) |
| Set callback for opening piano roll on a song. | |
| void | SetOnExportAsm (std::function< void(int)> callback) |
| Set callback for exporting a song to ASM. | |
| void | SetOnImportAsm (std::function< void(int)> callback) |
| Set callback for importing ASM to a song. | |
| int | GetSelectedSongIndex () const |
| void | SetSelectedSongIndex (int index) |
Private Member Functions | |
| void | DrawCustomSection (MusicBank &bank, int current_index) |
| void | DrawSongItem (MusicBank &bank, int index, bool is_selected, bool is_custom) |
| void | HandleContextMenu (MusicBank &bank, int index, bool is_custom) |
| bool | MatchesSearch (const std::string &name) const |
Private Attributes | |
| char | search_buffer_ [64] = "" |
| std::function< void(int)> | on_song_selected_ |
| std::function< void(int)> | on_open_tracker_ |
| std::function< void(int)> | on_open_piano_roll_ |
| std::function< void(int)> | on_export_asm_ |
| std::function< void(int)> | on_import_asm_ |
| std::function< void()> | on_edit_ |
| int | selected_song_index_ = 0 |
| int | rename_target_index_ = -1 |
UI component for browsing and managing songs.
Definition at line 19 of file song_browser_view.h.
|
default |
|
default |
| void yaze::editor::music::SongBrowserView::Draw | ( | MusicBank & | bank | ) |
Draw the song browser.
| bank | The music bank containing songs. |
Definition at line 16 of file song_browser_view.cc.
References yaze::zelda3::music::MusicBank::AllSongsFit(), yaze::zelda3::music::MusicBank::Auxiliary, yaze::zelda3::music::MusicBank::CalculateSpaceUsage(), yaze::zelda3::music::MusicBank::CreateNewSong(), yaze::zelda3::music::MusicBank::Credits, yaze::zelda3::music::MusicBank::DeleteSong(), yaze::zelda3::music::MusicBank::Dungeon, yaze::zelda3::music::MusicBank::DuplicateSong(), yaze::zelda3::music::MusicBank::GetExpandedBankInfo(), yaze::zelda3::music::MusicBank::GetSong(), yaze::zelda3::music::MusicBank::GetSongCount(), yaze::zelda3::music::MusicBank::HasExpandedMusicPatch(), ICON_MD_ADD, ICON_MD_AUDIOTRACK, ICON_MD_CHECK, ICON_MD_CHECK_CIRCLE, ICON_MD_CONTENT_COPY, ICON_MD_DELETE, ICON_MD_DRIVE_FILE_RENAME_OUTLINE, ICON_MD_EDIT, ICON_MD_ERROR, ICON_MD_FILE_DOWNLOAD, ICON_MD_FILE_UPLOAD, ICON_MD_LIBRARY_MUSIC, ICON_MD_MUSIC_NOTE, ICON_MD_PIANO, ICON_MD_SEARCH, ICON_MD_STORAGE, ICON_MD_WARNING, yaze::zelda3::music::MusicBank::IsVanilla(), MatchesSearch(), on_edit_, on_export_asm_, on_import_asm_, on_open_piano_roll_, on_open_tracker_, on_song_selected_, yaze::zelda3::music::MusicBank::Overworld, yaze::zelda3::music::MusicBank::OverworldExpanded, rename_target_index_, search_buffer_, and selected_song_index_.
Referenced by yaze::editor::MusicSongBrowserPanel::Draw(), and yaze::editor::MusicEditor::DrawSongBrowser().
|
inline |
Set callback for when a song is selected.
Definition at line 33 of file song_browser_view.h.
References on_song_selected_.
Referenced by yaze::editor::MusicSongBrowserPanel::SetOnSongSelected().
|
inline |
Set callback for when edits occur (e.g. renaming).
Definition at line 40 of file song_browser_view.h.
References on_edit_.
|
inline |
Definition at line 41 of file song_browser_view.h.
References on_edit_.
Referenced by yaze::editor::MusicSongBrowserPanel::SetOnEdit().
|
inline |
Set callback for opening tracker on a song.
Definition at line 46 of file song_browser_view.h.
References on_open_tracker_.
Referenced by yaze::editor::MusicSongBrowserPanel::SetOnOpenTracker().
|
inline |
Set callback for opening piano roll on a song.
Definition at line 53 of file song_browser_view.h.
References on_open_piano_roll_.
Referenced by yaze::editor::MusicSongBrowserPanel::SetOnOpenPianoRoll().
|
inline |
Set callback for exporting a song to ASM.
Definition at line 60 of file song_browser_view.h.
References on_export_asm_.
Referenced by yaze::editor::MusicSongBrowserPanel::SetOnExportAsm().
|
inline |
Set callback for importing ASM to a song.
Definition at line 67 of file song_browser_view.h.
References on_import_asm_.
Referenced by yaze::editor::MusicSongBrowserPanel::SetOnImportAsm().
|
inline |
Definition at line 71 of file song_browser_view.h.
References selected_song_index_.
Referenced by yaze::editor::MusicSongBrowserPanel::Draw(), and yaze::editor::MusicEditor::DrawSongBrowser().
|
inline |
Definition at line 72 of file song_browser_view.h.
References selected_song_index_.
Referenced by yaze::editor::MusicSongBrowserPanel::Draw(), and yaze::editor::MusicEditor::DrawSongBrowser().
|
private |
|
private |
|
private |
|
private |
Definition at line 248 of file song_browser_view.cc.
References search_buffer_.
Referenced by Draw().
|
private |
Definition at line 80 of file song_browser_view.h.
Referenced by Draw(), and MatchesSearch().
|
private |
Definition at line 84 of file song_browser_view.h.
Referenced by Draw(), and SetOnSongSelected().
|
private |
Definition at line 85 of file song_browser_view.h.
Referenced by Draw(), and SetOnOpenTracker().
|
private |
Definition at line 86 of file song_browser_view.h.
Referenced by Draw(), and SetOnOpenPianoRoll().
|
private |
Definition at line 87 of file song_browser_view.h.
Referenced by Draw(), and SetOnExportAsm().
|
private |
Definition at line 88 of file song_browser_view.h.
Referenced by Draw(), and SetOnImportAsm().
|
private |
Definition at line 89 of file song_browser_view.h.
Referenced by Draw(), SetOnEdit(), and SetOnEditCallback().
|
private |
Definition at line 92 of file song_browser_view.h.
Referenced by Draw(), GetSelectedSongIndex(), and SetSelectedSongIndex().
|
private |
Definition at line 93 of file song_browser_view.h.
Referenced by Draw().