Editor for SNES BRR samples. More...
#include <sample_editor_view.h>
Public Member Functions | |
| SampleEditorView ()=default | |
| ~SampleEditorView ()=default | |
| void | Draw (MusicBank &bank) |
| Draw the sample editor. | |
| void | SetOnEditCallback (std::function< void()> callback) |
| Set callback for when edits occur. | |
| void | SetOnPreviewCallback (std::function< void(int)> callback) |
| Set callback for sample preview. | |
Private Member Functions | |
| void | DrawSampleList (MusicBank &bank) |
| void | DrawProperties (MusicSample &sample) |
| void | DrawWaveform (const MusicSample &sample) |
Private Attributes | |
| int | selected_sample_index_ = 0 |
| std::vector< float > | plot_x_ |
| std::vector< float > | plot_y_ |
| std::function< void()> | on_edit_ |
| std::function< void(int)> | on_preview_ |
Editor for SNES BRR samples.
Definition at line 18 of file sample_editor_view.h.
|
default |
|
default |
| void yaze::editor::music::SampleEditorView::Draw | ( | MusicBank & | bank | ) |
Draw the sample editor.
| bank | The music bank containing samples. |
Definition at line 29 of file sample_editor_view.cc.
References DrawProperties(), DrawSampleList(), DrawWaveform(), yaze::zelda3::music::MusicBank::GetSample(), yaze::zelda3::music::MusicBank::GetSampleCount(), and selected_sample_index_.
Referenced by yaze::editor::MusicSampleEditorPanel::Draw(), and yaze::editor::MusicEditor::DrawSampleEditor().
|
inline |
Set callback for when edits occur.
Definition at line 32 of file sample_editor_view.h.
References on_edit_.
Referenced by yaze::editor::MusicSampleEditorPanel::SetOnEditCallback().
|
inline |
Set callback for sample preview.
Definition at line 37 of file sample_editor_view.h.
References on_preview_.
Referenced by yaze::editor::MusicSampleEditorPanel::SetOnPreviewCallback().
|
private |
Definition at line 60 of file sample_editor_view.cc.
References yaze::zelda3::music::MusicBank::GetSample(), yaze::zelda3::music::MusicBank::GetSampleCount(), yaze::zelda3::music::MusicBank::ImportSampleFromWav(), on_edit_, and selected_sample_index_.
Referenced by Draw().

|
private |
Definition at line 82 of file sample_editor_view.cc.
References yaze::zelda3::music::MusicSample::brr_data, ICON_MD_PLAY_ARROW, yaze::zelda3::music::MusicSample::loop_point, yaze::zelda3::music::MusicSample::loops, yaze::zelda3::music::MusicSample::name, on_edit_, on_preview_, and selected_sample_index_.
Referenced by Draw().
|
private |
Definition at line 159 of file sample_editor_view.cc.
References yaze::gui::plotting::EnsureImPlotContext(), yaze::zelda3::music::MusicSample::loop_point, yaze::zelda3::music::MusicSample::loops, yaze::zelda3::music::MusicSample::pcm_data, plot_x_, and plot_y_.
Referenced by Draw().

|
private |
Definition at line 48 of file sample_editor_view.h.
Referenced by Draw(), DrawProperties(), and DrawSampleList().
|
private |
Definition at line 51 of file sample_editor_view.h.
Referenced by DrawWaveform().
|
private |
Definition at line 52 of file sample_editor_view.h.
Referenced by DrawWaveform().
|
private |
Definition at line 55 of file sample_editor_view.h.
Referenced by DrawProperties(), DrawSampleList(), and SetOnEditCallback().
|
private |
Definition at line 56 of file sample_editor_view.h.
Referenced by DrawProperties(), and SetOnPreviewCallback().