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"; }
39 int GetPriority() const override { return 5; }
40
41 // ==========================================================================
42 // WindowContent Drawing
43 // ==========================================================================
44
45 void Draw(bool* p_open) override {
47 ImGui::TextDisabled(tr("Music bank not loaded"));
48 return;
49 }
50
53
54 // Update current song if selection changed
57 }
58 }
59
60 // ==========================================================================
61 // Callback Setters (for integration with MusicEditor)
62 // ==========================================================================
63
64 void SetOnSongSelected(std::function<void(int)> callback) {
67 }
68
69 void SetOnOpenTracker(std::function<void(int)> callback) {
72 }
73
74 void SetOnOpenPianoRoll(std::function<void(int)> callback) {
77 }
78
79 void SetOnExportAsm(std::function<void(int)> callback) {
82 }
83
84 void SetOnImportAsm(std::function<void(int)> callback) {
87 }
88
89 void SetOnEdit(std::function<void()> callback) {
92 }
93
94 private:
96 int* current_song_index_ = nullptr;
98};
99
100} // namespace editor
101} // namespace yaze
102
103#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