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

A class for editing music data in a Rom. More...

#include <music_editor.h>

Inheritance diagram for yaze::editor::MusicEditor:

Public Member Functions

 MusicEditor (Rom *rom=nullptr)
 
void Initialize () override
 
absl::Status Load () override
 
absl::Status Save () override
 
absl::Status Update () override
 
absl::Status Cut () override
 
absl::Status Copy () override
 
absl::Status Paste () override
 
absl::Status Undo () override
 
absl::Status Redo () override
 
absl::Status Find () override
 
void set_rom (Rom *rom)
 
Romrom () const
 
void set_emulator (emu::Emulator *emulator)
 
emu::Emulatoremulator () const
 
void PlaySong (int song_id)
 
void StopSong ()
 
void SetVolume (float volume)
 
- Public Member Functions inherited from yaze::editor::Editor
 Editor ()=default
 
virtual ~Editor ()=default
 
virtual absl::Status Clear ()
 
EditorType type () const
 
void set_context (EditorContext *context)
 
bool * active ()
 
void set_active (bool active)
 
virtual bool IsRomLoaded () const
 
virtual std::string GetRomStatus () const
 

Private Member Functions

void DrawTrackerView ()
 
void DrawInstrumentEditor ()
 
void DrawSampleEditor ()
 
void DrawToolset ()
 
void StartPlayback ()
 
void StopPlayback ()
 
void UpdatePlayback ()
 

Private Attributes

AssemblyEditor assembly_editor_
 
zelda3::music::Tracker music_tracker_
 
int current_song_index_ = 0
 
int current_pattern_index_ = 0
 
int current_channel_index_ = 0
 
bool is_playing_ = false
 
std::vector< bool > channel_muted_ = std::vector<bool>(8, false)
 
std::vector< bool > channel_soloed_ = std::vector<bool>(8, false)
 
std::vector< std::string > song_names_
 
ImGuiTableFlags music_editor_flags_
 
ImGuiTableFlags toolset_table_flags_
 
Romrom_
 
emu::Emulatoremulator_ = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::Editor
std::string MakeCardTitle (const std::string &base_title) const
 
template<typename T >
absl::StatusOr< T > SafeRomAccess (std::function< T()> accessor, const std::string &operation="") const
 
- Protected Attributes inherited from yaze::editor::Editor
bool active_ = false
 
EditorType type_
 
EditorContextcontext_ = nullptr
 

Detailed Description

A class for editing music data in a Rom.

Definition at line 64 of file music_editor.h.

Constructor & Destructor Documentation

◆ MusicEditor()

yaze::editor::MusicEditor::MusicEditor ( Rom rom = nullptr)
inlineexplicit

Definition at line 66 of file music_editor.h.

References yaze::editor::kMusic, and yaze::editor::Editor::type_.

Member Function Documentation

◆ Initialize()

void yaze::editor::MusicEditor::Initialize ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 15 of file music_editor.cc.

◆ Load()

absl::Status yaze::editor::MusicEditor::Load ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 17 of file music_editor.cc.

Referenced by yaze::editor::EditorManager::LoadAssets().

◆ Save()

absl::Status yaze::editor::MusicEditor::Save ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 72 of file music_editor.h.

◆ Update()

absl::Status yaze::editor::MusicEditor::Update ( )
overridevirtual
Todo:
Add music channel view

Implements yaze::editor::Editor.

Definition at line 22 of file music_editor.cc.

References assembly_editor_, DrawToolset(), yaze::editor::AssemblyEditor::InlineUpdate(), and music_editor_flags_.

Here is the call graph for this function:

◆ Cut()

absl::Status yaze::editor::MusicEditor::Cut ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 74 of file music_editor.h.

◆ Copy()

absl::Status yaze::editor::MusicEditor::Copy ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 75 of file music_editor.h.

◆ Paste()

absl::Status yaze::editor::MusicEditor::Paste ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 76 of file music_editor.h.

◆ Undo()

absl::Status yaze::editor::MusicEditor::Undo ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 77 of file music_editor.h.

◆ Redo()

absl::Status yaze::editor::MusicEditor::Redo ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 78 of file music_editor.h.

◆ Find()

absl::Status yaze::editor::MusicEditor::Find ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 79 of file music_editor.h.

◆ set_rom()

void yaze::editor::MusicEditor::set_rom ( Rom rom)
inline

Definition at line 82 of file music_editor.h.

References rom(), and rom_.

Here is the call graph for this function:

◆ rom()

Rom * yaze::editor::MusicEditor::rom ( ) const
inline

Definition at line 85 of file music_editor.h.

References rom_.

Referenced by DrawToolset(), and set_rom().

◆ set_emulator()

void yaze::editor::MusicEditor::set_emulator ( emu::Emulator emulator)
inline

Definition at line 88 of file music_editor.h.

References emulator(), and emulator_.

Here is the call graph for this function:

◆ emulator()

emu::Emulator * yaze::editor::MusicEditor::emulator ( ) const
inline

Definition at line 89 of file music_editor.h.

References emulator_.

Referenced by set_emulator().

◆ PlaySong()

void yaze::editor::MusicEditor::PlaySong ( int  song_id)

Definition at line 219 of file music_editor.cc.

References yaze::emu::Emulator::audio_backend(), emulator_, is_playing_, LOG_ERROR, LOG_INFO, LOG_WARN, and yaze::emu::Emulator::snes().

Here is the call graph for this function:

◆ StopSong()

void yaze::editor::MusicEditor::StopSong ( )

Definition at line 252 of file music_editor.cc.

References yaze::emu::Emulator::audio_backend(), emulator_, is_playing_, LOG_ERROR, LOG_INFO, and yaze::emu::Emulator::snes().

Here is the call graph for this function:

◆ SetVolume()

void yaze::editor::MusicEditor::SetVolume ( float  volume)

Definition at line 271 of file music_editor.cc.

References yaze::emu::Emulator::audio_backend(), emulator_, LOG_DEBUG, and LOG_WARN.

Here is the call graph for this function:

◆ DrawTrackerView()

void yaze::editor::MusicEditor::DrawTrackerView ( )
private

◆ DrawInstrumentEditor()

void yaze::editor::MusicEditor::DrawInstrumentEditor ( )
private

◆ DrawSampleEditor()

void yaze::editor::MusicEditor::DrawSampleEditor ( )
private

◆ DrawToolset()

void yaze::editor::MusicEditor::DrawToolset ( )
private

◆ StartPlayback()

void yaze::editor::MusicEditor::StartPlayback ( )
private

◆ StopPlayback()

void yaze::editor::MusicEditor::StopPlayback ( )
private

◆ UpdatePlayback()

void yaze::editor::MusicEditor::UpdatePlayback ( )
private

Member Data Documentation

◆ assembly_editor_

AssemblyEditor yaze::editor::MusicEditor::assembly_editor_
private

Definition at line 108 of file music_editor.h.

Referenced by Update().

◆ music_tracker_

zelda3::music::Tracker yaze::editor::MusicEditor::music_tracker_
private

Definition at line 109 of file music_editor.h.

Referenced by DrawToolset().

◆ current_song_index_

int yaze::editor::MusicEditor::current_song_index_ = 0
private

Definition at line 113 of file music_editor.h.

◆ current_pattern_index_

int yaze::editor::MusicEditor::current_pattern_index_ = 0
private

Definition at line 114 of file music_editor.h.

◆ current_channel_index_

int yaze::editor::MusicEditor::current_channel_index_ = 0
private

Definition at line 115 of file music_editor.h.

◆ is_playing_

bool yaze::editor::MusicEditor::is_playing_ = false
private

Definition at line 116 of file music_editor.h.

Referenced by PlaySong(), and StopSong().

◆ channel_muted_

std::vector<bool> yaze::editor::MusicEditor::channel_muted_ = std::vector<bool>(8, false)
private

Definition at line 117 of file music_editor.h.

◆ channel_soloed_

std::vector<bool> yaze::editor::MusicEditor::channel_soloed_ = std::vector<bool>(8, false)
private

Definition at line 118 of file music_editor.h.

◆ song_names_

std::vector<std::string> yaze::editor::MusicEditor::song_names_
private

Definition at line 119 of file music_editor.h.

◆ music_editor_flags_

ImGuiTableFlags yaze::editor::MusicEditor::music_editor_flags_
private
Initial value:
=
ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersOuter |
ImGuiTableFlags_BordersV | ImGuiTableFlags_SizingFixedFit

Definition at line 121 of file music_editor.h.

Referenced by Update().

◆ toolset_table_flags_

ImGuiTableFlags yaze::editor::MusicEditor::toolset_table_flags_
private
Initial value:
=
ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_BordersOuter |
ImGuiTableFlags_BordersV | ImGuiTableFlags_PadOuterX

Definition at line 125 of file music_editor.h.

Referenced by DrawToolset().

◆ rom_

Rom* yaze::editor::MusicEditor::rom_
private

Definition at line 129 of file music_editor.h.

Referenced by rom(), and set_rom().

◆ emulator_

emu::Emulator* yaze::editor::MusicEditor::emulator_ = nullptr
private

Definition at line 130 of file music_editor.h.

Referenced by emulator(), PlaySong(), set_emulator(), SetVolume(), and StopSong().


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