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#include "util/i18n/tr.h"
7
10#include "app/gui/core/icons.h"
12
13namespace yaze {
14namespace editor {
15
23 public:
25 music::SampleEditorView* sample_view)
26 : music_bank_(music_bank), sample_view_(sample_view) {}
27
28 // ==========================================================================
29 // WindowContent Identity
30 // ==========================================================================
31
32 std::string GetId() const override { return "music.sample_editor"; }
33 std::string GetDisplayName() const override { return "Sample Editor"; }
34 std::string GetIcon() const override { return ICON_MD_WAVES; }
35 std::string GetEditorCategory() const override { return "Music"; }
36 int GetPriority() const override { return 25; }
37
38 // ==========================================================================
39 // WindowContent Drawing
40 // ==========================================================================
41
42 void Draw(bool* p_open) override {
43 if (!music_bank_ || !sample_view_) {
44 ImGui::TextDisabled(tr("Music bank not loaded"));
45 return;
46 }
47
49 }
50
51 // ==========================================================================
52 // Callback Setters
53 // ==========================================================================
54
55 void SetOnEditCallback(std::function<void()> callback) {
56 if (sample_view_)
58 }
59
60 void SetOnPreviewCallback(std::function<void(int)> callback) {
61 if (sample_view_)
63 }
64
65 private:
68};
69
70} // namespace editor
71} // namespace yaze
72
73#endif // YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_SAMPLE_EDITOR_PANEL_H_
WindowContent 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.
Base interface for all logical window content components.
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