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#include "util/i18n/tr.h"
7
10#include "app/gui/core/icons.h"
12
13namespace yaze {
14namespace editor {
15
23 public:
25 int* current_song_index,
26 music::SongBrowserView* song_browser_view)
27 : music_bank_(music_bank),
28 current_song_index_(current_song_index),
29 song_browser_view_(song_browser_view) {}
30
31 // ==========================================================================
32 // WindowContent Identity
33 // ==========================================================================
34
35 std::string GetId() const override { return "music.song_browser"; }
36 std::string GetDisplayName() const override { return "Song Browser"; }
37 std::string GetIcon() const override { return ICON_MD_LIBRARY_MUSIC; }
38 std::string GetEditorCategory() const override { return "Music"; }
42 int GetPriority() const override { return 5; }
43
44 // ==========================================================================
45 // WindowContent Drawing
46 // ==========================================================================
47
48 void Draw(bool* p_open) override {
50 ImGui::TextDisabled(tr("Music bank not loaded"));
51 return;
52 }
53
56
57 // Update current song if selection changed
60 }
61 }
62
63 // ==========================================================================
64 // Callback Setters (for integration with MusicEditor)
65 // ==========================================================================
66
67 void SetOnSongSelected(std::function<void(int)> callback) {
70 }
71
72 void SetOnOpenTracker(std::function<void(int)> callback) {
75 }
76
77 void SetOnOpenPianoRoll(std::function<void(int)> callback) {
80 }
81
82 void SetOnExportAsm(std::function<void(int)> callback) {
85 }
86
87 void SetOnImportAsm(std::function<void(int)> callback) {
90 }
91
92 void SetOnEdit(std::function<void()> callback) {
95 }
96
97 private:
99 int* current_song_index_ = nullptr;
101};
102
103} // namespace editor
104} // namespace yaze
105
106#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.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
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
static WindowPresentationPolicy OptionalPopOut()