yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::music::InstrumentEditorView Class Reference

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_
 

Detailed Description

Editor for SNES instruments (ADSR, Gain, Samples).

Definition at line 19 of file instrument_editor_view.h.

Constructor & Destructor Documentation

◆ InstrumentEditorView()

yaze::editor::music::InstrumentEditorView::InstrumentEditorView ( )
default

◆ ~InstrumentEditorView()

yaze::editor::music::InstrumentEditorView::~InstrumentEditorView ( )
default

Member Function Documentation

◆ Draw()

void yaze::editor::music::InstrumentEditorView::Draw ( MusicBank & bank)

Draw the instrument editor.

Parameters
bankThe 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().

Here is the call graph for this function:

◆ SetOnEditCallback()

void yaze::editor::music::InstrumentEditorView::SetOnEditCallback ( std::function< void()> callback)
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().

◆ SetOnPreviewCallback()

void yaze::editor::music::InstrumentEditorView::SetOnPreviewCallback ( std::function< void(int)> callback)
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().

◆ DrawInstrumentList()

void yaze::editor::music::InstrumentEditorView::DrawInstrumentList ( MusicBank & bank)
private

◆ DrawProperties()

◆ DrawAdsrGraph()

void yaze::editor::music::InstrumentEditorView::DrawAdsrGraph ( const MusicInstrument & instrument)
private

Member Data Documentation

◆ selected_instrument_index_

int yaze::editor::music::InstrumentEditorView::selected_instrument_index_ = 0
private

Definition at line 49 of file instrument_editor_view.h.

Referenced by Draw(), DrawInstrumentList(), and DrawProperties().

◆ plot_x_

std::vector<float> yaze::editor::music::InstrumentEditorView::plot_x_
private

Definition at line 52 of file instrument_editor_view.h.

Referenced by DrawAdsrGraph().

◆ plot_y_

std::vector<float> yaze::editor::music::InstrumentEditorView::plot_y_
private

Definition at line 53 of file instrument_editor_view.h.

Referenced by DrawAdsrGraph().

◆ on_edit_

std::function<void()> yaze::editor::music::InstrumentEditorView::on_edit_
private

Definition at line 56 of file instrument_editor_view.h.

Referenced by DrawInstrumentList(), DrawProperties(), and SetOnEditCallback().

◆ on_preview_

std::function<void(int)> yaze::editor::music::InstrumentEditorView::on_preview_
private

Definition at line 57 of file instrument_editor_view.h.

Referenced by DrawProperties(), and SetOnPreviewCallback().


The documentation for this class was generated from the following files: