Editor for SNES instruments (ADSR, Gain, Samples). More...
#include <instrument_editor_view.h>
Public Member Functions | |
| InstrumentEditorView ()=default | |
| ~InstrumentEditorView ()=default | |
| void | Draw (MusicBank &bank) |
| Draw the instrument editor. | |
| void | SetOnEditCallback (std::function< void()> callback) |
| Set callback for when edits occur (to trigger undo save). | |
| void | SetOnPreviewCallback (std::function< void(int)> callback) |
| Set callback for instrument preview. | |
Private Member Functions | |
| void | DrawInstrumentList (MusicBank &bank) |
| void | DrawProperties (MusicInstrument &instrument, MusicBank &bank) |
| void | DrawAdsrGraph (const MusicInstrument &instrument) |
Private Attributes | |
| int | selected_instrument_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 instruments (ADSR, Gain, Samples).
Definition at line 19 of file instrument_editor_view.h.
|
default |
|
default |
| void yaze::editor::music::InstrumentEditorView::Draw | ( | MusicBank & | bank | ) |
Draw the instrument editor.
| bank | The music bank containing instruments. |
Definition at line 29 of file instrument_editor_view.cc.
References DrawInstrumentList(), DrawProperties(), yaze::zelda3::music::MusicBank::GetInstrument(), yaze::zelda3::music::MusicBank::GetInstrumentCount(), and selected_instrument_index_.
Referenced by yaze::editor::MusicInstrumentEditorPanel::Draw(), and yaze::editor::MusicEditor::DrawInstrumentEditor().

|
inline |
Set callback for when edits occur (to trigger undo save).
Definition at line 33 of file instrument_editor_view.h.
References on_edit_.
Referenced by yaze::editor::MusicInstrumentEditorPanel::SetOnEditCallback().
|
inline |
Set callback for instrument preview.
Definition at line 38 of file instrument_editor_view.h.
References on_preview_.
Referenced by yaze::editor::MusicInstrumentEditorPanel::SetOnPreviewCallback().
|
private |
Definition at line 50 of file instrument_editor_view.cc.
References yaze::zelda3::music::MusicBank::CreateNewInstrument(), yaze::zelda3::music::MusicBank::GetInstrument(), yaze::zelda3::music::MusicBank::GetInstrumentCount(), on_edit_, and selected_instrument_index_.
Referenced by Draw().

|
private |
Definition at line 67 of file instrument_editor_view.cc.
References yaze::zelda3::music::MusicInstrument::attack, yaze::zelda3::music::MusicInstrument::decay, DrawAdsrGraph(), yaze::zelda3::music::MusicBank::GetSample(), yaze::zelda3::music::MusicBank::GetSampleCount(), ICON_MD_PLAY_ARROW, yaze::zelda3::music::MusicInstrument::name, on_edit_, on_preview_, yaze::zelda3::music::MusicInstrument::pitch_mult, yaze::zelda3::music::MusicInstrument::sample_index, selected_instrument_index_, yaze::zelda3::music::MusicInstrument::sustain_level, and yaze::zelda3::music::MusicInstrument::sustain_rate.
Referenced by Draw().

|
private |
Definition at line 170 of file instrument_editor_view.cc.
References yaze::zelda3::music::MusicInstrument::attack, yaze::gui::plotting::EnsureImPlotContext(), plot_x_, plot_y_, yaze::zelda3::music::MusicInstrument::sustain_level, and yaze::zelda3::music::MusicInstrument::sustain_rate.
Referenced by DrawProperties().

|
private |
Definition at line 49 of file instrument_editor_view.h.
Referenced by Draw(), DrawInstrumentList(), and DrawProperties().
|
private |
Definition at line 52 of file instrument_editor_view.h.
Referenced by DrawAdsrGraph().
|
private |
Definition at line 53 of file instrument_editor_view.h.
Referenced by DrawAdsrGraph().
|
private |
Definition at line 56 of file instrument_editor_view.h.
Referenced by DrawInstrumentList(), DrawProperties(), and SetOnEditCallback().
|
private |
Definition at line 57 of file instrument_editor_view.h.
Referenced by DrawProperties(), and SetOnPreviewCallback().