yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sample_editor_view.h
Go to the documentation of this file.
1#ifndef YAZE_EDITOR_MUSIC_SAMPLE_EDITOR_VIEW_H
2#define YAZE_EDITOR_MUSIC_SAMPLE_EDITOR_VIEW_H
3
4#include <functional>
5#include <vector>
6
8
9namespace yaze {
10namespace editor {
11namespace music {
12
13using namespace yaze::zelda3::music;
14
19 public:
20 SampleEditorView() = default;
21 ~SampleEditorView() = default;
22
27 void Draw(MusicBank& bank);
28
32 void SetOnEditCallback(std::function<void()> callback) { on_edit_ = callback; }
33
37 void SetOnPreviewCallback(std::function<void(int)> callback) {
38 on_preview_ = callback;
39 }
40
41 private:
42 // UI Helper methods
43 void DrawSampleList(MusicBank& bank);
44 void DrawProperties(MusicSample& sample);
45 void DrawWaveform(const MusicSample& sample);
46
47 // State
49
50 // Plot data
51 std::vector<float> plot_x_;
52 std::vector<float> plot_y_;
53
54 // Callbacks
55 std::function<void()> on_edit_;
56 std::function<void(int)> on_preview_;
57};
58
59} // namespace music
60} // namespace editor
61} // namespace yaze
62
63#endif // YAZE_EDITOR_MUSIC_SAMPLE_EDITOR_VIEW_H
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 DrawWaveform(const MusicSample &sample)
void Draw(MusicBank &bank)
Draw the sample editor.
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.
A BRR-encoded audio sample.
Definition song_data.h:388