yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
instrument_editor_view.h
Go to the documentation of this file.
1#ifndef YAZE_EDITOR_MUSIC_INSTRUMENT_EDITOR_VIEW_H
2#define YAZE_EDITOR_MUSIC_INSTRUMENT_EDITOR_VIEW_H
3
4#include <functional>
5#include <vector>
6
9
10namespace yaze {
11namespace editor {
12namespace music {
13
14using namespace yaze::zelda3::music;
15
20 public:
23
28 void Draw(MusicBank& bank);
29
33 void SetOnEditCallback(std::function<void()> callback) { on_edit_ = callback; }
34
38 void SetOnPreviewCallback(std::function<void(int)> callback) {
39 on_preview_ = callback;
40 }
41
42 private:
43 // UI Helper methods
44 void DrawInstrumentList(MusicBank& bank);
45 void DrawProperties(MusicInstrument& instrument, MusicBank& bank);
46 void DrawAdsrGraph(const MusicInstrument& instrument);
47
48 // State
50
51 // Plot data
52 std::vector<float> plot_x_;
53 std::vector<float> plot_y_;
54
55 // Callbacks
56 std::function<void()> on_edit_;
57 std::function<void(int)> on_preview_;
58};
59
60} // namespace music
61} // namespace editor
62} // namespace yaze
63
64#endif // YAZE_EDITOR_MUSIC_INSTRUMENT_EDITOR_VIEW_H
65
Editor for SNES instruments (ADSR, Gain, Samples).
void SetOnEditCallback(std::function< void()> callback)
Set callback for when edits occur (to trigger undo save).
void DrawAdsrGraph(const MusicInstrument &instrument)
void Draw(MusicBank &bank)
Draw the instrument editor.
void DrawProperties(MusicInstrument &instrument, MusicBank &bank)
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
Contains classes and functions for handling music data in Zelda 3.
An instrument definition with ADSR envelope.
Definition song_data.h:358