yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
music_sample_editor_panel.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_SAMPLE_EDITOR_PANEL_H_
2#define YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_SAMPLE_EDITOR_PANEL_H_
3
4#include <functional>
5#include <string>
6
11
12namespace yaze {
13namespace editor {
14
22 public:
24 music::SampleEditorView* sample_view)
25 : music_bank_(music_bank), sample_view_(sample_view) {}
26
27 // ==========================================================================
28 // EditorPanel Identity
29 // ==========================================================================
30
31 std::string GetId() const override { return "music.sample_editor"; }
32 std::string GetDisplayName() const override { return "Sample Editor"; }
33 std::string GetIcon() const override { return ICON_MD_WAVES; }
34 std::string GetEditorCategory() const override { return "Music"; }
35 int GetPriority() const override { return 25; }
36
37 // ==========================================================================
38 // EditorPanel Drawing
39 // ==========================================================================
40
41 void Draw(bool* p_open) override {
42 if (!music_bank_ || !sample_view_) {
43 ImGui::TextDisabled("Music bank not loaded");
44 return;
45 }
46
48 }
49
50 // ==========================================================================
51 // Callback Setters
52 // ==========================================================================
53
54 void SetOnEditCallback(std::function<void()> callback) {
56 }
57
58 void SetOnPreviewCallback(std::function<void(int)> callback) {
60 }
61
62 private:
65};
66
67} // namespace editor
68} // namespace yaze
69
70#endif // YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_SAMPLE_EDITOR_PANEL_H_
Base interface for all logical panel components.
EditorPanel wrapper for the sample editor.
std::string GetId() const override
Unique identifier for this panel.
void SetOnEditCallback(std::function< void()> callback)
void SetOnPreviewCallback(std::function< void(int)> callback)
std::string GetIcon() const override
Material Design icon for this panel.
MusicSampleEditorPanel(zelda3::music::MusicBank *music_bank, music::SampleEditorView *sample_view)
void Draw(bool *p_open) override
Draw the panel content.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
void SetOnPreviewCallback(std::function< void(int)> callback)
Set callback for sample preview.
void SetOnEditCallback(std::function< void()> callback)
Set callback for when edits occur.
void Draw(MusicBank &bank)
Draw the sample editor.
Manages the collection of songs, instruments, and samples from a ROM.
Definition music_bank.h:27
#define ICON_MD_WAVES
Definition icons.h:2133