yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
music_instrument_editor_panel.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_INSTRUMENT_EDITOR_PANEL_H_
2#define YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_INSTRUMENT_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::InstrumentEditorView* instrument_view)
26 : music_bank_(music_bank), instrument_view_(instrument_view) {}
27
28 // ==========================================================================
29 // WindowContent Identity
30 // ==========================================================================
31
32 std::string GetId() const override { return "music.instrument_editor"; }
33 std::string GetDisplayName() const override { return "Instrument Editor"; }
34 std::string GetIcon() const override { return ICON_MD_SPEAKER; }
35 std::string GetEditorCategory() const override { return "Music"; }
36 int GetPriority() const override { return 20; }
37
38 // ==========================================================================
39 // WindowContent Drawing
40 // ==========================================================================
41
42 void Draw(bool* p_open) override {
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) {
58 }
59
60 void SetOnPreviewCallback(std::function<void(int)> callback) {
63 }
64
65 private:
68};
69
70} // namespace editor
71} // namespace yaze
72
73#endif // YAZE_APP_EDITOR_MUSIC_PANELS_MUSIC_INSTRUMENT_EDITOR_PANEL_H_
WindowContent wrapper for the instrument editor.
std::string GetId() const override
Unique identifier for this panel.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetEditorCategory() const override
Editor category this panel belongs to.
void Draw(bool *p_open) override
Draw the panel content.
void SetOnPreviewCallback(std::function< void(int)> callback)
void SetOnEditCallback(std::function< void()> callback)
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
std::string GetIcon() const override
Material Design icon for this panel.
MusicInstrumentEditorPanel(zelda3::music::MusicBank *music_bank, music::InstrumentEditorView *instrument_view)
Base interface for all logical window content components.
Editor for SNES instruments (ADSR, Gain, Samples).
void SetOnEditCallback(std::function< void()> callback)
Set callback for when edits occur (to trigger undo save).
void Draw(MusicBank &bank)
Draw the instrument editor.
void SetOnPreviewCallback(std::function< void(int)> callback)
Set callback for instrument preview.
Manages the collection of songs, instruments, and samples from a ROM.
Definition music_bank.h:27
#define ICON_MD_SPEAKER
Definition icons.h:1812