yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
music_song_browser_panel.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_SONG_BROWSER_PANEL_H_
2#define YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_SONG_BROWSER_PANEL_H_
3
4#include <functional>
5#include <string>
6
11
12namespace yaze {
13namespace editor {
14
22 public:
24 int* current_song_index,
25 music::SongBrowserView* song_browser_view)
26 : music_bank_(music_bank),
27 current_song_index_(current_song_index),
28 song_browser_view_(song_browser_view) {}
29
30 // ==========================================================================
31 // WindowContent Identity
32 // ==========================================================================
33
34 std::string GetId() const override { return "music.song_browser"; }
35 std::string GetDisplayName() const override { return "Song Browser"; }
36 std::string GetIcon() const override { return ICON_MD_LIBRARY_MUSIC; }
37 std::string GetEditorCategory() const override { return "Music"; }
38 int GetPriority() const override { return 5; }
39
40 // ==========================================================================
41 // WindowContent Drawing
42 // ==========================================================================
43
44 void Draw(bool* p_open) override {
46 ImGui::TextDisabled("Music bank not loaded");
47 return;
48 }
49
52
53 // Update current song if selection changed
56 }
57 }
58
59 // ==========================================================================
60 // Callback Setters (for integration with MusicEditor)
61 // ==========================================================================
62
63 void SetOnSongSelected(std::function<void(int)> callback) {
66 }
67
68 void SetOnOpenTracker(std::function<void(int)> callback) {
71 }
72
73 void SetOnOpenPianoRoll(std::function<void(int)> callback) {
76 }
77
78 void SetOnExportAsm(std::function<void(int)> callback) {
81 }
82
83 void SetOnImportAsm(std::function<void(int)> callback) {
86 }
87
88 void SetOnEdit(std::function<void()> callback) {
91 }
92
93 private:
95 int* current_song_index_ = nullptr;
97};
98
99} // namespace editor
100} // namespace yaze
101
102#endif // YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_SONG_BROWSER_PANEL_H_
WindowContent wrapper for the music song browser.
void SetOnExportAsm(std::function< void(int)> callback)
std::string GetIcon() const override
Material Design icon for this panel.
MusicSongBrowserPanel(zelda3::music::MusicBank *music_bank, int *current_song_index, music::SongBrowserView *song_browser_view)
void SetOnOpenPianoRoll(std::function< void(int)> callback)
std::string GetEditorCategory() const override
Editor category this panel belongs to.
void SetOnEdit(std::function< void()> callback)
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
int GetPriority() const override
Get display priority for menu ordering.
void SetOnImportAsm(std::function< void(int)> callback)
void Draw(bool *p_open) override
Draw the panel content.
std::string GetId() const override
Unique identifier for this panel.
void SetOnSongSelected(std::function< void(int)> callback)
void SetOnOpenTracker(std::function< void(int)> callback)
Base interface for all logical window content components.
UI component for browsing and managing songs.
void SetOnOpenTracker(std::function< void(int)> callback)
Set callback for opening tracker on a song.
void SetOnEdit(std::function< void()> callback)
void Draw(MusicBank &bank)
Draw the song browser.
void SetOnSongSelected(std::function< void(int)> callback)
Set callback for when a song is selected.
void SetOnExportAsm(std::function< void(int)> callback)
Set callback for exporting a song to ASM.
void SetOnOpenPianoRoll(std::function< void(int)> callback)
Set callback for opening piano roll on a song.
void SetOnImportAsm(std::function< void(int)> callback)
Set callback for importing ASM to a song.
Manages the collection of songs, instruments, and samples from a ROM.
Definition music_bank.h:27
#define ICON_MD_LIBRARY_MUSIC
Definition icons.h:1080