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

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_
 

Detailed Description

Editor for SNES BRR samples.

Definition at line 18 of file sample_editor_view.h.

Constructor & Destructor Documentation

◆ SampleEditorView()

yaze::editor::music::SampleEditorView::SampleEditorView ( )
default

◆ ~SampleEditorView()

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

Member Function Documentation

◆ Draw()

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

◆ SetOnEditCallback()

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

◆ SetOnPreviewCallback()

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

◆ DrawSampleList()

void yaze::editor::music::SampleEditorView::DrawSampleList ( MusicBank & bank)
private
Todo
Implement file dialog for BRR import

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

Here is the call graph for this function:

◆ DrawProperties()

◆ DrawWaveform()

void yaze::editor::music::SampleEditorView::DrawWaveform ( const MusicSample & sample)
private

Member Data Documentation

◆ selected_sample_index_

int yaze::editor::music::SampleEditorView::selected_sample_index_ = 0
private

Definition at line 48 of file sample_editor_view.h.

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

◆ plot_x_

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

Definition at line 51 of file sample_editor_view.h.

Referenced by DrawWaveform().

◆ plot_y_

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

Definition at line 52 of file sample_editor_view.h.

Referenced by DrawWaveform().

◆ on_edit_

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

Definition at line 55 of file sample_editor_view.h.

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

◆ on_preview_

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

Definition at line 56 of file sample_editor_view.h.

Referenced by DrawProperties(), and SetOnPreviewCallback().


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