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"; }
39 int GetPriority() const override { return 25; }
40
41 // ==========================================================================
42 // WindowContent Drawing
43 // ==========================================================================
44
45 void Draw(bool* p_open) override {
46 if (!music_bank_ || !sample_view_) {
47 ImGui::TextDisabled(tr("Music bank not loaded"));
48 return;
49 }
50
52 }
53
54 // ==========================================================================
55 // Callback Setters
56 // ==========================================================================
57
58 void SetOnEditCallback(std::function<void()> callback) {
59 if (sample_view_)
61 }
62
63 void SetOnPreviewCallback(std::function<void(int)> callback) {
64 if (sample_view_)
66 }
67
68 private:
71};
72
73} // namespace editor
74} // namespace yaze
75
76#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.
WindowPresentationPolicy GetPresentationPolicy() const override
How this content is hosted and advertised by workspace chrome.
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
static WindowPresentationPolicy OptionalPopOut()